Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
/ upiqr Public

This project is a TypeScript library that generates NPCI's UPI QR code (BASE64) along with UPI intent link, which can be used for payment through UPI-enabled apps.

License

Notifications You must be signed in to change notification settings

bhar4t/upiqr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

npm package Build Status Downloads Issues Commitizen Friendly Semantic Release

Generate NPCI's UPI QR code (BASE64) along with UPI intent link, By using it any payment is possible from UPI enabled apps.

Supports


This package will work on client and server.

  import upiqr from "upiqr";

  upiqr({
    payeeVPA: "bhar4t@upi",
    payeeName: "Bharat Sahu"
  })
  .then(({ qr }) => {
    console.log(qr)      // data:image/png;base64,eR0lGODP...
  })
  .catch(console.error)

Fields detail:

Fields Description Required
payeeVPA UPI ID of the payee (e.g., example@upi). Yes
payeeName Registered name of the payee (e.g., John Doe). Yes
payeeMerchantCode Merchant Code from UPI payment account No
transactionId Unique transaction id for merchant's reference No
transactionRef Unique transaction id for merchant's reference No
transactionNote Note for the payment (e.g., Electricity Bill). No
amount Amount No
minimumAmount Amount to be paid (e.g., 100.00 or 499). No
currency Currency of amount (default: INR) No
transactionRefUrl URL for the order No

In table, fields requirement column is based on static QR, For dynamic QR you need to change more fields along with payeeVPA and payeeName.

For a complete list of supported fields, refer to the NPCI UPI Linking Specs

Customization:

Internally using qrcode for QR Generation. And, it accepts second optional param object for cusomizing the QR code.

  upiqr(intentFields, {
    color: {
      dark: '#000000',
      light: '#FFFFFF'
    }
  })

About

This project is a TypeScript library that generates NPCI's UPI QR code (BASE64) along with UPI intent link, which can be used for payment through UPI-enabled apps.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published