upiqr 1.0.40 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import QRCode from 'qrcode';
|
|
2
2
|
export default function upiqr({ payeeVPA: pa, payeeName: pn, payeeMerchantCode: me, transactionId: tid, transactionRef: tr, transactionNote: tn, amount: am, minimumAmount: mam, currency: cu, }) {
|
|
3
3
|
return new Promise((resolve, reject) => {
|
|
4
4
|
let error = validateParams({ pa, pn });
|
|
@@ -22,10 +22,9 @@ export default function upiqr({ payeeVPA: pa, payeeName: pn, payeeMerchantCode:
|
|
|
22
22
|
if (tn)
|
|
23
23
|
intent = buildUrl.call(intent, { tn });
|
|
24
24
|
intent = intent.substring(0, intent.length - 1);
|
|
25
|
-
QRCode
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
25
|
+
QRCode
|
|
26
|
+
.toDataURL(intent)
|
|
27
|
+
.then((base64Data) => resolve({ qr: base64Data, intent }))
|
|
28
|
+
.catch(err => reject(new Error("Unable to generate UPI QR Code.\n" + err)));
|
|
30
29
|
});
|
|
31
30
|
}
|
package/package.json
CHANGED