upiqr 1.3.5 → 1.3.8

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/README.md CHANGED
@@ -67,7 +67,6 @@ Internally using `qrcode` for QR Generation. And, it accepts [second optional pa
67
67
 
68
68
  ```
69
69
 
70
-
71
70
  <!--- [![Code Coverage][codecov-img]][codecov-url] --->
72
71
 
73
72
  [build-img]:https://github.com/bhar4t/upiqr/actions/workflows/main.yml/badge.svg
@@ -85,4 +84,4 @@ Internally using `qrcode` for QR Generation. And, it accepts [second optional pa
85
84
  [commitizen-img]:https://img.shields.io/badge/commitizen-friendly-brightgreen.svg
86
85
  [commitizen-url]:http://commitizen.github.io/cz-cli/
87
86
  [qr-code-options]:https://www.npmjs.com/package/qrcode#qr-code-options
88
- [upi-specs-url]:https://www.npci.org.in/PDF/npci/upi/circular/2017/Circular18_BankCompliances_to_enbaleUPIMerchantecosystem_0.pdf
87
+ [upi-specs-url]:https://www.npci.org.in/PDF/npci/upi/circular/2017/Circular18_BankCompliances_to_enbaleUPIMerchantecosystem_0.pdf
package/dist/index.d.ts CHANGED
@@ -1,3 +1,9 @@
1
1
  import QRCode from 'qrcode';
2
2
  import { QRResult, UPIIntentParams } from './types/upiqr';
3
+ /**
4
+ * Generates a UPI QR code and intent URL.
5
+ * @param {UPIIntentParams} params - The UPI intent parameters.
6
+ * @param {QRCode.QRCodeToDataURLOptions} [qrOptions] - Optional QR code generation options.
7
+ * @returns {Promise<QRResult>} - A promise that resolves to the QR code and intent URL.
8
+ */
3
9
  export default function upiqr({ payeeVPA: pa, payeeName: pn, payeeMerchantCode: mc, transactionId: tid, transactionRef: tr, transactionNote: tn, amount: am, minimumAmount: mam, currency: cu, }: UPIIntentParams, qrOptions?: QRCode.QRCodeToDataURLOptions): Promise<QRResult>;
@@ -1,5 +1,15 @@
1
+ /**
2
+ * Supported image types for the QR code.
3
+ */
1
4
  export type ImageType = 'png' | 'jpeg' | 'webp';
5
+ /**
6
+ * Base64 encoded image string.
7
+ * @template imageType - The type of the image.
8
+ */
2
9
  export type Base64<imageType extends ImageType> = `data:image/${imageType};base64,${string}`;
10
+ /**
11
+ * Parameters for generating UPI intent.
12
+ */
3
13
  export interface UPIIntentParams {
4
14
  payeeVPA: string;
5
15
  payeeName: string;
@@ -12,6 +22,9 @@ export interface UPIIntentParams {
12
22
  currency?: string;
13
23
  transactionRefUrl?: string;
14
24
  }
25
+ /**
26
+ * Result of the UPI QR code generation.
27
+ */
15
28
  export interface QRResult {
16
29
  qr: Base64<ImageType>;
17
30
  intent: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "upiqr",
3
- "version": "1.3.5",
3
+ "version": "1.3.8",
4
4
  "description": "Generate NPCI's UPI QR code along with UPI intent link, By using it any payment is possible from UPI enabled apps.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",