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

@setu/upi-deep-links

v3.0.0

Published

NPM package to connect to Setu's UPI Deep Link APIs

Downloads

693

Readme

Setu UPI Deeplinks: NodeJS SDK

@setu/upi-deep-links is a NodeJS SDK for accessing Setu’s UPI Deeplinks APIs. The SDK is designed with ease of access in mind, with full TypeScript support.

Version Downloads Size License

Getting started

SDK documentation →
Full documentation →
Product overview →

Installation

  • npm
npm install @setu/upi-deep-links
  • yarn
yarn add @setu/upi-deep-links

Features

  • Full support for latest UPI Deeplinks APIs
  • Type definitions for all inputs & outputs
  • Allows both JWT & OAuth authentication mechanisms
  • SANDBOX mode to test integration & PRODUCTION for live data
  • Internal mechanism for OAuth authentication to automatically re-fetch token when current one expires, and retry all failed requests.

Examples

Setup

import { SetuUPIDeepLink } from "@setu/upi-deep-links";

const upidl = SetuUPIDeepLink({
    schemeID: "5bf4376b-6008-43c8-8ce0-a5ea196e3091",
    secret: "9975fd99-d5ed-416a-9963-5d113dc80582",
    productInstanceID: "861023031961584801",
    mode: "SANDBOX",
    authType: "JWT",
});

Generate UPI payment link

const paymentLinkBody = {
    amountValue: 20000, // amount in paisa
    billerBillID: "918147077472", // Unique merchant platform identifier for bill
    amountExactness: "EXACT",
    // Optional fields
    settlement: {
        parts: [
            {
                account: {
                    id: "987654321",
                    ifsc: "KKBK0000001",
                },
                remarks: "EXACT sample split",
                split: {
                    unit: "INR",
                    value: 10000,
                },
            },
        ],
        primaryAccount: {
            id: "123456789",
            ifsc: "KKBK0000001",
        },
    },
};

const data = await upiDL.createPaymentLink(paymentLinkBody);

Check status of UPI payment link

const data = await upiDL.checkPaymentStatus("891365293916423373");

Trigger mock payment for UPI payment link (Sandbox only)

const data = await upidl.triggerMockPayment({
    amountValue: 200, // amount in rupees
    platformBillID: "891365293916423373",
    vpa: "nareshlocal@kaypay", // Merchant VPA
});

Expire a UPI payment link

const data = await upiDL.expireBill("891365293916423373");

Initiate refunds

const data = await upiDL.initiateRefund({
    refunds: [
        {
            identifier: platformBillID,
            identifierType: "BILL_ID",
            refundType: "FULL",
            deductions: [
                {
                    account: {
                        id: "123456789",
                        ifsc: "KKBK0000001",
                    },
                    split: {
                        unit: "INR",
                        value: 10000,
                    },
                },
                {
                    account: {
                        id: "987654321",
                        ifsc: "KKBK0000001",
                    },
                    split: {
                        unit: "INR",
                        value: 10000,
                    },
                },
            ],
        },
    ],
});

Get refund batch status

const data = await upiDL.getRefundBatchStatus(initiateRefundResponse.batchID);

Get individual refund status

const data = await upiDL.getRefundStatus(getRefundBatchStatusResponse.refunds[0].id);

Contributing

Have a look through existing Issues and Pull Requests that you could help with. If you'd like to request a feature or report a bug, please create a GitHub Issue using the template provided.

See contribution guide →

License

MIT. Have at it.