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

netpay-lib

v0.0.31

Published

Netpay library

Downloads

21

Readme

Netpay Library

The netpay library is a helpful library for launching netpay on websites and webapps

Getting started

First import the script to your project

<!-- For use from a cdn -->
<script src="https://unpkg.com/netpay-lib@latest/umd/netpay.min.js"></script>

or in a javascript project, first install the netpay library in your project

yarn add netpay-lib
// or
npm install netpay-lib

then include the library in your project

// in an ES6 environment
import Netpay from 'netpay-lib';

// or in a CommonJs environment
const Netpay = require('netpay-lib');

Using Netpay

To use netpay, you simply call the createPayment method on the netpay library passing in the payment options object. This returns an instance of a payment. To open the netpay window, call the open method on the payment object

// Create the payment instance

const payment = Netpay.createPayment({
  amount: 400000,
  
  reference: 'SFSE552VB',
  
  email: '[email protected]',
  
  merchantKey: 'Your-Merchant-Key',
  
  callback: function(response){
  	alert(`The payment with reference ${response.reference} was successful`);
  },
  
  onClose: function() {
    alert(`The payment attempt failed`);
  }
  // You can find the rest of the payment options in the definition file below
});
payment.open();

The PaymentOptions object looks like this

  interface PaymentOptions {
    /**
     * The amount in lower denominations. e.g if you want to send `₦1,560` the amount to send is `156000`
     */
    amount: number,

    /**
     * A unique string to identify the transaction.
     */
    reference: string,

    /**
     * The email of the client. This serves as a user id for your customer
     */
    email: string,

    /**
     * The merchant key. This can be obtained from the netpay dashboard
     */
    merchantKey: string,

    /**
     * The currency with which the client would be charged
     * 
     * @default 'NGN'
     */
    currencyCode?: string,

    /**
     * The ID of the DOM Element or the actual DOM Element with which the 
     * payment gateway would be mounted. Note that the style of the 
     * specified element would be modified  while the payment gateway
     * is active. The original styles would be reverted once the gateway
     * is closed
     */
    container?: string | HTMLElement,

    /**
     * A callback function that is called when a payment is successful
     */
    callback?: () => void,

    /**
     * A callback function that is called when a payment is cancelled
     */
    onClose?: () => void,

    meta?: object,

    /**
     * When a color string is provided, it will override the color of the payment gateway
     * It can be any valid css color e.g `blue`, `#45eeff`, `rgba(235,23,123)`
     */
    color?: string,

    /**
     * Sets the mode of payment
     *
     * - **live**: transactions done in this mode would be would actuated in the real world
     * - **test**: Transactions done in this mode would make api calls, but moneys are never moved
     * - **demo**: Transactions done in this mode are all mocked. No api calls just simulations
     */
    mode?: Netpay.PaymentModes,

    /**
     * When in Demo mode, You can specify custom info for the demo
     */
    demoOptions?: Netpay.DemoOptions
  }