🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

@omkarbhosale/upiqr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@omkarbhosale/upiqr

This package helps to generate dynamic QR code using UPI ID to accept payment.

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Official Documentation

Install the package using the following command

npm i @omkarbhosale/upiqr

Once the package is installed, you can import the library using import:

import generateQR from "@omkarbhosale/upiqr";

Example

// Import the package
import generateQR from "@omkarbhosale/upiqr";

// Async funtion is required to generate the QR and retrun the promise as Base64 URL

const qrData = async () => {
  try {
    // Get the Base64 string by using generateQR() function.
    // UPI_ID accepts the UPI ID where to recive money in
    // AMOUNT must be an integer or float.

    let data = await generateQR({ UPI_ID: "omkar@upi", AMOUNT: 1234 });

    // The above code will generate and return the Base64 Code
    console.log(data);
  } catch (error) {
    console.error("Error generating QR code:", error);
  }
};

qrData();

Authors

  • Omkar Bhosale

Keywords

upi

FAQs

Package last updated on 02 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts