npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vivekkushwaha66/upi-deeplink-builder

v0.0.1

Published

**Library is compatible with front end and backend**

Downloads

2

Readme

@vivekkushwaha66/upi-deeplink-builder

Library is compatible with front end and backend

UPI is a real-time payment system developed by NPCI, with which funds can be transferred instantly to any bank account. Through Collect DeepLinks, that conform to NPCI specs, a merchant can enable their customers to directly go to a UPI app with pre-filled payment information.

Any business that wants to collect payments for goods or services provided to a customer using UPI DeepLinks.

Provide payment details and generate deep links that work across supported UPI apps. Your customers can make payments using any UPI app available on their phone, like PhonePe or GPay.

Link Specification and Parameters

UPI Deep linking URL spec must be as follows.

upi://pay?parm-name=param-value&param-name=pram-value&

Where param-name can be any of the valid parameters (based on mandatory vs optional) listed in below table. M-Mandatory, C-Conditional, O-Optional |Parameter name | Data type |Static mode Tags |Dynamic mode Tags |Mapped to UPI API field |Description| |--|--|---|--|--|--| |pa|String |M |M |Payee-->addr |Payee VPA |pn|String |M |M |Payee-->name |Payee name |mc|String |O | O |Payee-->mcc |Payee merchant code If present then needs to be passed as it is. |tid|String |O | O |Txn -->id |This must be PSP generated id when present. In the case of Merchant payments, merchant may acquire the txn id from his PSP. If present then needs to be passed as it is. |tr|String |O | C | Txn-->refId |Transaction reference ID. This could be order number, subscription number, Bill ID, booking ID, insurance renewal reference, etc. This field is Mandatory for Merchant transactions and dynamic URL generation. |tn|String |O | O |Txn-->note |Transaction note providing a short description of the transaction. |am|String |O | O |Payee--> Amount-->value |Transaction amount in decimal format. If ‘am’ is not present then field is editable. |mam|String |O | O |Txn -->Rules --> MINAMOUNT |Minimum amount to be paid if different from transaction amount. |cu|String |O | O |Payee--> Amount-->curr |Currency code. Currently ONLY "INR" is the supported value. |url|String |O | O |Txn-->refUrl |This should be a URL when clicked provides customer with further transaction details like complete bill details, bill copy, order copy, ticket details, etc. This can also be used to deliver digital goods such as mp3 files etc. after payment. This URL, when used, MUST BE related to the particular transaction and MUST NOT be used to send unsolicited information that are not relevant to the transaction. url should initiate with http or https.

Usage

const { DeeplinkBuilder } = require('@vivekkushwaha66/upi-deeplink-builder')
const builder = new DeeplinkBuilder('payee name', 'payeevpa@upi')
const deepLink = builder.build()

Other Methods

| Method Name | Usage | Description | |--|--|--| |addMerchantCode | builder.addMerchantCode('merchantCode') |Payee merchant code |addTransactionId| builder.addTransactionId('transactionId') |This must be PSP generated id when present. In the case of Merchant payments, merchant may acquire the txn id from his PSP. If present then needs to be passed as it is |addTransactionReferenceId| builder.addTransactionReferenceId('refId') |Transaction reference ID. This could be order number, subscription number, Bill ID, booking ID, insurance renewal reference, etc. This field is Mandatory for Merchant transactions and dynamic URL generation |addTransactionNote| builder.addTransactionNote('note') |Transaction note providing a short description of the transaction |addTransactionAmount| builder.addTransactionAmount('amount') |Transaction amount in decimal format. |addMinimumAmount| builder.addMinimumAmount('minimumAmount') |Minimum amount to be paid if different from transaction amount. |addCurrencyCode| builder.addCurrencyCode('code') |* Currency code. Currently ONLY “INR” is the supported value |addUrl| builder.addUrl('url') |This should be a URL when clicked provides customer with further transaction details like complete bill details, bill copy, order copy, ticket details, etc. This can also be used to deliver digital goods such as mp3 files etc. after payment. This URL, when used, MUST BE related to the particular transaction and MUST NOT be used to send unsolicited information that are not relevant to the transaction.

Above methods can be chained before calling build method. for ex:-

const { DeeplinkBuilder } = require('@vivekkushwaha66/upi-deeplink-builder')
const builder = new DeeplinkBuilder('Payee Name', 'payeevpa@upi')
builder.addTransactionAmount('20')
console.log(builder.build())
output: upi://pay?pn=Payee Name&pa=payeevpa@upi&am=20