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 🙏

© 2026 – Pkg Stats / Ryan Hefner

capacitor-gray-upi

v0.0.6

Published

Plugin for UPI

Readme

capacitor-gray-upi

Description

UPI Payments Plugin that uses EasyUpiPayment library.

This Plugin implements the EasyUpiPayment library to initiate UPI payment and handle events.

Supported platforms

  • Android

Android setup

  • npm i capacitor-gray-upi
  • ionic build
  • npx cap copy
  • npx cap sync
  • npx cap open android
  • [extra step] in android case we need to tell Capacitor to initialise the plugin:

on your MainActivity.java file add import com.grayhat.upi.GrayUPI; and then inside the init callback add(GrayUPI.class);

Now you should be set to go. Try to run your client using npx cap open android.

Tip: every time you change a native code you may need to clean up the cache (Build > Clean Project | Build > Rebuild Project) and then run the app again.

Example

import { Plugins } from '@capacitor/core';
import 'capacitor-gray-upi';

const { GrayUPI } = Plugins;

// ...code

//function to start payment (handle errors yourself)
startPayment = async () => {
  GrayUPI.addListener('onTransactionCompleted', (res: any) => {
    alert(JSON.stringify(res));
  });
  GrayUPI.addListener('onTransactionCancelled', (res: any) => {
    alert(JSON.stringify(res));
  });
  GrayUPI.initialise({
    transID: "**********",
    transRefID: "**********",
    amount: '1.00',
    description: 'Test Payment',
    vpa: '1234567890@service',
    name: 'Sample Name',
  })
    .then(() => {
      GrayUPI.startPayment();
    })
    .catch((err: any) => {
      alert(JSON.stringify(err));
    });
};

initialise(transaction:Transaction)

This initialises the UPI Plugin and prepares it for startPayment() call.

Returns Promise<void>

Transaction

interface Transaction {
    vpa: string;
    name: string;
    transID: string;
    transRefID: string;
    description: string;
    amount: string; // decimal format
}

startPayment()

This starts the payment intent on Android where the user chooses an App for UPI Payment and proceeds.

Returns Promise<void>

Event : 'onTransactionCompleted'

listener : (transaction:TransactionDetails) => void

Transaction Completed with "SUBMITTED"|"SUCCESS"|"FAILURE" status

  • SUBMITTED : Transaction is in PENDING state. Money might get deducted from user’s account but not yet deposited in payee’s account.
  • SUCCESS : Transaction is successful.
  • FAILURE : Transaction is failed.

TransactionDetails

interface TransactionDetails {
    transID : string;
    responseCode : string;
    approvalRefNo : string;
    transactionStatus : "SUBMITTED"|"SUCCESS"|"FAILURE";
    transactionRefId : string;
    amount : string;
}

Event : 'onTransactionCancelled'

listener : () => void

User cancelled transaction or transaction failed

Testing

Manually tested against the following platforms:

  • Android device 10.0 (API Level 29)