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

@netappsng/pay

v2.0.2

Published

A simple, secure payment SDK for accepting payments on your website.

Readme

NetAppsPay SDK V2

A simple, secure payment SDK for accepting payments on your website.


Table of Contents

| Section | Description | |---------|-------------| | Installation | NPM package and Script tag installation | | React Integration | React/Next.js implementation guide | | Script Widget | Vanilla JS implementation for any website | | Configuration Options | All available parameters | | Payment Channels | Available payment methods | | Response Format | Success and failure response structure | | Test Cards | Cards for testing in sandbox mode | | Support | Help and documentation links |


Installation

NPM Package (for React/Next.js)

npm install @netappsng/pay
# or
yarn add @netappsng/pay

Script Tag (for any website)

<script src="https://cdn.netapps.ng.com/netapps-pay.js"></script>

React Integration

Basic Usage

import React, { useState } from 'react';
import { PaymentModal, type PaymentConfig } from '@netappsng/pay';

function CheckoutPage() {
  const [showPayment, setShowPayment] = useState(false);

  const config: PaymentConfig = {
    // Required fields
    publicKey: 'pk_live_xxxxxxxxxxxx',
    amount: 500000,                      // Amount in kobo (₦5,000)
    currency: 'NGN',
    email: '[email protected]',
    fullname: 'John Doe',
    phoneNumber: '08012345678',
    address1: '123 Main Street, Lagos',
    paymentChannels: ['card', 'transfer', 'ussd', 'payattitude'],
    
    // Optional fields
    narration: 'Payment for Order #123',
    businessName: 'My Store',
    metadata: { orderId: 'ORD_123' },
    
    // Callbacks
    onSuccess: (response) => {
      console.log('Payment successful:', response);
      setShowPayment(false);
    },
    onFailed: (response) => {
      console.log('Payment failed:', response);
    },
    onClose: () => {
      setShowPayment(false);
    },
  };

  return (
    <div>
      <button onClick={() => setShowPayment(true)}>Pay ₦5,000</button>
      {showPayment && <PaymentModal config={config} />}
    </div>
  );
}

export default CheckoutPage;

Using the Hook

import { useNetAppsPay } from '@netappsng/pay';

function PaymentButton() {
  const { pay, isLoading } = useNetAppsPay({
    publicKey: 'pk_live_xxxxxxxxxxxx'
    });

  const handlePayment = () => {
    pay({
      amount: 500000,
      email: '[email protected]',
      fullname: 'John Doe',
      phoneNumber: '08012345678',
      address1: '123 Main Street, Lagos',
      paymentChannels: ['card', 'transfer'],
      onSuccess: (response) => {
        console.log('Success:', response);
      },
      onFailed: (response) => {
        console.log('Failed:', response);
      },
      onClose: () => {
        console.log('Widget closed');
      },
    });
  };

  return (
    <button onClick={handlePayment} disabled={isLoading}>
      {isLoading ? 'Processing...' : 'Pay ₦5,000'}
    </button>
  );
}

Next.js Integration

// pages/checkout.tsx or app/checkout/page.tsx
'use client'; // Required for App Router

import dynamic from 'next/dynamic';
import { useState } from 'react';

// Dynamic import to avoid SSR issues
const PaymentModal = dynamic(
  () => import('@netappsng/pay').then(mod => mod.PaymentModal),
  { ssr: false }
);

export default function CheckoutPage() {
  const [showPayment, setShowPayment] = useState(false);

  return (
    <div>
      <button onClick={() => setShowPayment(true)}>Pay Now</button>
      
      {showPayment && (
        <PaymentModal
          config={{
            publicKey: 'pk_live_xxxxxxxxxxxx',
            amount: 500000,
            email: '[email protected]',
            fullname: 'John Doe',
            phoneNumber: '08012345678',
            address1: '123 Main Street, Lagos',
            paymentChannels: ['card', 'transfer'],
            onSuccess: (res) => {
              console.log('Success:', res);
              setShowPayment(false);
            },
            onClose: () => setShowPayment(false),
          }}
        />
      )}
    </div>
  );
}

Script Widget

Works with any website - HTML, WordPress, PHP, Vue, Angular, etc.

Basic Usage

<!DOCTYPE html>
<html>
<head>
  <title>Payment Page</title>
</head>
<body>
  <button id="payBtn">Pay ₦5,000</button>

  <script src="https://cdn.netappspay.com/netapps-pay.js"></script>
  
  <script>
    // Initialize with your public key
    const netappsPay = new NetAppsPay('pk_live_xxxxxxxxxxxx');
    
    document.getElementById('payBtn').onclick = function() {
      netappsPay.pay({
        // Required fields
        amount: 500000,                    // Amount in kobo (₦5,000)
        email: '[email protected]',
        fullname: 'John Doe',
        phoneNumber: '08012345678',
        address1: '123 Main Street, Lagos',
        paymentChannels: 'card,transfer,ussd,payattitude',
        
        // Optional fields
        currency: 'NGN',
        narration: 'Payment for Order #123',
        metadata: { orderId: 'ORD_123' },
        
        // Callbacks
        onSuccessful: function(response) {
          console.log('Payment successful:', response);
          // Verify payment on your server
        },
        onFailed: function(response) {
          console.log('Payment failed:', response);
        },
        onClose: function() {
          console.log('Widget closed');
        }
      });
    };
  </script>
</body>
</html>

Custom Widget URL

// For testing with a different widget URL
const netappsPay = new NetAppsPay('pk_test_xxxxxxxxxxxx');

Configuration Options

Required Parameters

| Parameter | Type | Description | |-----------|------|-------------| | publicKey | string | Your NetApps public key (starts with pk_live_ or pk_test_) | | amount | number | Amount in minor units (kobo for NGN). Min: 10000 (₦100) | | email | string | Customer's email address | | fullname | string | Customer's full name (first and last) | | phoneNumber | string | Customer's phone number | | address1 | string | Customer's address | | paymentChannels | string/array | Payment methods to display |

Optional Parameters

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | currency | string | 'NGN' | Currency code ('NGN' or 'USD') | | narration | string | - | Payment description | | transactionRef | string | Auto-generated | Your unique transaction reference | | chargeAllocation | string | 'CUSTOMER' | Who pays fees: 'CUSTOMER' or 'MERCHANT' | | metadata | object | - | Custom data to attach to transaction | | businessName | string | - | Your business name (shown in sdk) | | city | string | - | Customer's city | | defaultChannel | string | - | Pre-selected payment channel |

Callbacks

| Callback | Description | |----------|-------------| | onSuccessful / onSuccess | Called when payment is successful | | onFailed | Called when payment fails | | onClose | Called when sdk is closed | | onReady | Called when sdk is ready (script only) |


Payment Channels

| Channel | Code | Description | |---------|------|-------------| | Card | card | Debit/Credit card (Visa, Mastercard, Verve) | | Bank Transfer | transfer | Pay via bank transfer to virtual account | | USSD | ussd | Dial USSD code to complete payment | | PayAttitude | payattitude | Mobile push notification payment |

Script Widget: paymentChannels: 'card,transfer,ussd,payattitude'

React/NPM: paymentChannels: ['card', 'transfer', 'ussd', 'payattitude']


Response Format

Success Response

{
  status: 'success',
  merchantRef: 'YOUR_REF_123',
  transactionRef: 'NETAPPS_260117_xxxxx',
  amount: 5000,           // Amount in major units (₦5,000)
  currency: 'NGN',
  channel: 'card',
  message: 'Payment successful',
  timestamp: '2026-01-17T12:00:00Z'
}

Failed Response

{
  status: 'failed',
  amount: 5000,
  currency: 'NGN',
  message: 'Card declined',
  errorCode: 'CARD_DECLINED',
  timestamp: '2026-01-17T12:00:00Z'
}

Test Cards

Use these cards in test mode:

| Card Number | Expiry | CVV | Result | |-------------|--------|-----|--------| | 4000000000000002 | Any future date | Any 3 digits | Success | | 5200000000000007 | Any future date | Any 3 digits | Success (3DS) | | 4000000000000010 | Any future date | Any 3 digits | Declined |


Support

  • Documentation: https://docs.netapps.ng
  • Email: [email protected]
  • Website: https://netapps.ng