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

@paycashless/qpi.js

v0.2.1

Published

manipulate qpi data objects

Readme

QR Payment Intent

This library allows you to encode and decode QPI data objects. Note: it won't generate a QR image, it only creates what can be used as the content of the QR code, you'll have use a seperate library for generating QR codes.

Get started

npm install @paycashless/qpi.js

encode

This function encodes your payment intent data objects into a string that can be easily embeded in a QR code.

  import { QrPaymentIntent } from '@paycashless/qpi.js';

  const dataObjects = {
    version: '01',
    intentType: IntentType.static,
    merchantAccount: {
      accountIndex: '1',
      merchantId: '1'
    },
    merchantCategoryCode: '4111', // transportation
    countryCode: 'NG',
    payeeName: 'GRUBWAYS',
    city: 'ABUJA',
    postalCode: '900231',
    amount: '5000',
    currency: '566', // NGN
    additionalDataObjects: {
      storeLabel: '055',
      customerLabel: 'cust_2bt7pwl20mb25sa',
      terminalLabel: '05',
      reference: '567223',
      narration: 'FOOD DELIVERY',
      channel: '521' // online
    },
    paymentIntentDataObjects: {
      token: "tok_neojvjkwPrrpr9e03hplcag2ig5gpua8"
    },
  }

  const qpi = new QrPaymentIntent();
  const payload = qpi.encode(dataObjects);
  console.log(payload);

decode

This function allows you to decode a QR payment intent payload back to readable data objects

import { QrPaymentIntent } from '@paycashless/qpi.js';

const payload = '00020101021236370114grubways61@fbn0015com.paycashless520441115802NG5908GRUBWAYS6005ABUJA6106900231540450005303566627703030550620customer@example.com0702050512PAY_567228030813FOOD DELIVERY110352180590136tok_neojvjkwPrrpr9e03hplcag2ig5gpua80015com.paycashless6304B06F';
const qpi = new QrPaymentIntent();
const dataObjects = qpi.decode(payload);
console.log(dataObjects);

Data Objects

You can find all the possible data objects listed below;

interface DataObjects {
  version: string;
  intentType: IntentType;
  checksum: string;
  payeeAccount: {
    schemeIdentifier: string;
    financialAddress: string;
  };
  merchantCategoryCode: string;
  countryCode: string;
  payeeName: string;
  city: string;
  postalCode: string;
  payeeInfoAltLanguage?: {
    localLanguage: string;
    payeeName: string;
    city: string;
  };
  amount: string;
  currency: string;
  serviceFee?: string;
  percentageServiceFee?: string;
  additionalDataObjects: {
    storeLabel: string;
    customerLabel: string;
    terminalLabel: string;
    loyaltyNumber?: string;
    reference: string;
    narration: string;
    channel: string;
  };
  paymentIntentDataObjects: {
    schemeIdentifier: string;
    token: string;
  },
}

merchantCategoryCode data object shall contain MCC as defined by [ISO 18245]

countryCode data object shall contain the country code of the merchant as defined by [ISO 3166-1 alpha-2]

additionalDataObjects.channel has three chracters, each chracter in each position identifies the characteristic of the channel used for the transaction. The possible value of each character and its definition are listed below

currency data object is to conform with [ISO 4217] containing 3 digit numeric representation of the transaction currency

Channel: First chracter (Media)

| Value | Meaning | | ----------- | ----------- | | "0" | Print - Merchant Sticker | | "1" | Print - Bill/Invoice | | "2" | Print - Magazine/Poster | | "3" | Print - Other | | "4" | Screen/Electronic - Merchant POS/POI | | "5" | Screen/Electronic - Website | | "6" | Screen/Electronic - App | | "7" | Screen/Electronic - Other |

Channel: Second chracter (Transaction Location)

| Value | Meaning | | ----------- | ----------- | | "0" | At Merchant premises/registered address | | "1" | Not at merchant premises/registered address | | "2" | Remote commerce | | "3" | Other |

Channel: Third chracter (Merchant Presence)

| Value | Meaning | | ----------- | ----------- | | "0" | Attended POI | | "1" | Unattended | | "2" | Semi attended (Self-checkout) | | "3" | Other |

STICKER = 033 INVOICE = 133 POSTER = 233 OTHER_PRINT = 333 POS = 433 WEB = 533 APP = 633 OTHER_ELECTRONIC = 733

STICKER_MERCHANT_PRESENT=000 STICKER_MERCHANT_NOT_PRESENT=001 STICKER_SELF_CHECKOUT=002 STICKER_REMOTE_LOCATION=011

INVOICE_MERCHANT_PRESENT=100 INVOICE_MERCHANT_NOT_PRESENT=101 INVOICE_SELF_CHECKOUT=102 INVOICE_REMOTE_LOCATION=111

POSTER_MERCHANT_PRESENT=200 POSTER_MERCHANT_NOT_PRESENT=201 POSTER_SELF_CHECKOUT=202 POSTER_REMOTE_LOCATION=211

OTHER_PRINT_MERCHANT_PRESENT=300 OTHER_PRINT_MERCHANT_NOT_PRESENT=301 OTHER_PRINT_SELF_CHECKOUT=302 OTHER_PRINT_REMOTE_LOCATION=311

POS_MERCHANT_PRESENT=400 POS_MERCHANT_NOT_PRESENT=411 POS_SELF_CHECKOUT=402

WEB_MERCHANT_PRESENT=500 WEB_MERCHANT_NOT_PRESENT=511 WEB_SELF_CHECKOUT=502

APP_MERCHANT_PRESENT=600 APP_MERCHANT_NOT_PRESENT=611 APP_SELF_CHECKOUT=602

OTHER_ELECTRONIC_MERCHANT_PRESENT=700 OTHER_ELECTRONIC_MERCHANT_NOT_PRESENT=711 OTHER_ELECTRONIC_SELF_CHECKOUT=702