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 🙏

© 2025 – Pkg Stats / Ryan Hefner

kora-checkout

v1.0.4

Published

A JavaScript SDK for integrating with Kora's Checkout Standard payment gateway

Readme

Kora Checkout

A JavaScript SDK for integrating with Kora's Checkout Standard payment gateway.

Installation

npm install kora-checkout
# or
yarn add kora-checkout

Usage

React + TypeScript Example

import KoraPayment, { KoraPaymentOptions } from 'kora-checkout';

const handlePayment = () => {
    const paymentOptions: KoraPaymentOptions = {
        key: "pk_test_***********************",
        reference: `ref-${Date.now()}`,
        amount: 5000, // Example amount
        customer: {
            name: "Jane Doe",
            email: "[email protected]"
        },
        onSuccess: () => {
            console.log('Payment successful');
        },
        onFailed: (err: { message: string }) => {
            console.error(err.message);
        }
    };

    const payment = new KoraPayment();
    payment.initialize(paymentOptions);
};

return (
    <button onClick={handlePayment} className="bg-green-500 text-white p-3 rounded">
        Pay with Kora
    </button>
);

API Reference

Constructor

const koraPayment = new KoraPayment(config);

Parameters:

  • config (optional): Default configuration options that will be used for all payment initializations.

Methods

initialize(options)

Initializes the payment gateway with the provided options.

koraPayment.initialize({
  key: "pk_test_xxxxxxxxxxxxxxxxx",  // Replace with your public key
  reference: "your-unique-reference", // Unique for each transaction
  amount: 22000, 
  currency: "NGN",
  customer: {
    name: "John Doe",
    email: "[email protected]"
  }
});

CommonJS

const { KoraPayment } = require('kora-checkout');
const koraPayment = new KoraPayment();

koraPayment.initialize({
  key: "pk_test_xxxxxxxxxxxxxxxxx",  
  reference: "your-unique-reference",
  amount: 22000, 
  currency: "NGN",
  customer: {
    name: "John Doe",
    email: "[email protected]"
  }
});

Browser (UMD)

<script src="https://unpkg.com/kora-checkout/dist/index.js"></script>
<script>
  const payment = new KoraPayment();
  function payWithKora() {
    payment.initialize({
      key: "pk_test_xxxxxxxxxxxxxxxxx",
      reference: "your-unique-reference",
      amount: 22000, 
      currency: "NGN",
      customer: {
        name: "John Doe",
        email: "[email protected]"
      }
    });
  }
</script>

<button onclick="payWithKora()">Pay Now</button>
##### Required Options:

- `key`: Your public key from Korapay
- `reference`: Your unique transaction reference
- `amount`: Amount to be collected
- `customer`: Object containing customer details
  - `customer.name`: Customer name
  - `customer.email`: Customer email address

##### Optional Options:

- `currency`: Currency of the charge (default: "NGN")
- `notification_url`: HTTPS endpoint for webhook notifications
- `narration`: Information about the transaction
- `channels`: Methods of payment (e.g., ["bank_transfer", "card"])
- `default_channel`: Method of payment active by default
- `metadata`: Custom data to include with transaction (max 5 fields)
- `containerId`: ID of HTML element to contain the payment gateway
- `onClose`: Function called when payment gateway is closed
- `onSuccess`: Function called when payment is successful
- `onFailed`: Function called when payment fails
- `onTokenized`: Function called when card tokenization is successful
- `onPending`: Function called for pending bank transfers
- `merchant_bears_cost`: Boolean indicating who bears transaction fees

#### close()

Closes the payment modal programmatically.

```javascript
koraPayment.close();

License

MIT

Kora Checkout Logo