upiqr 1.0.41 → 1.0.42
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.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/utils/helper.d.ts +2 -2
- package/dist/utils/helper.js +2 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { UPIIntentParams, UPIIntentResult } from
|
|
1
|
+
import { UPIIntentParams, UPIIntentResult } from './types/upiqr';
|
|
2
2
|
export default function upiqr({ payeeVPA: pa, payeeName: pn, payeeMerchantCode: me, transactionId: tid, transactionRef: tr, transactionNote: tn, amount: am, minimumAmount: mam, currency: cu, }: UPIIntentParams): Promise<UPIIntentResult>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import QRCode from 'qrcode';
|
|
2
|
+
import { buildUrl, validateParams } from './utils/helper';
|
|
2
3
|
export default function upiqr({ payeeVPA: pa, payeeName: pn, payeeMerchantCode: me, transactionId: tid, transactionRef: tr, transactionNote: tn, amount: am, minimumAmount: mam, currency: cu, }) {
|
|
3
4
|
return new Promise((resolve, reject) => {
|
|
4
5
|
let error = validateParams({ pa, pn });
|
package/dist/utils/helper.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
declare function validateParams({ pa, pn }: {
|
|
1
|
+
export declare function validateParams({ pa, pn }: {
|
|
2
2
|
pa: string | undefined;
|
|
3
3
|
pn: string | undefined;
|
|
4
4
|
}): string;
|
|
5
|
-
declare function buildUrl(this: string, params: object): string;
|
|
5
|
+
export declare function buildUrl(this: string, params: object): string;
|
package/dist/utils/helper.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
function validateParams({ pa, pn }) {
|
|
1
|
+
export function validateParams({ pa, pn }) {
|
|
3
2
|
let error = '';
|
|
4
3
|
if (!pa || !pn)
|
|
5
4
|
return "Virtual Payee's Address/Payee's Name is compulsory";
|
|
@@ -7,7 +6,7 @@ function validateParams({ pa, pn }) {
|
|
|
7
6
|
return "Virtual Payee's Address/Payee's Name is too short.";
|
|
8
7
|
return error;
|
|
9
8
|
}
|
|
10
|
-
function buildUrl(params) {
|
|
9
|
+
export function buildUrl(params) {
|
|
11
10
|
let url = this, qs = "";
|
|
12
11
|
for (let [key, value] of Object.entries(params))
|
|
13
12
|
qs += encodeURIComponent(key) + "=" + encodeURIComponent(value) + "&";
|
package/package.json
CHANGED