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

@stradox/paystack

v0.3.32

Published

A Paystack API wrapper, written in TypeScript

Readme

PAYSTACK-API

This is a Typescript wrapper for the Paystack API, providing strongly typed interfaces and methods for interacting with the API.

The aim is to simplify the process of integrating Paystack into your application by providing a simple and easy-to-use package, providing type-hinting and autocompletion in your IDE.

It is built using Deno, and can be used in Deno, Node.js, or any other JavaScript runtime (server side). For the ESM-only version of this package, see here.

Installation

To install the package, run one of the following commands in your terminal, depending upon your package manager:

Npm

  $ npm install @stradox/paystack

Yarn

  $ yarn add @stradox/paystack

Pnpm

  $ pnpm install @stradox/paystack

Usage

To use the package, import the Paystack class from the package and create an instance of it, passing your secret key as an argument. You can then call the various methods on the instance to interact with the Paystack API.

import { Paystack } from '@stradox/paystack';

const paystack = new Paystack(<your_secret_key>);

const transaction = await paystack.transaction.initialize({
  amount: 10000,
  email: "[email protected]",
});

Alternatively, you can use the exported getPaystack function to create an instance of the Paystack class, passing your secret key as an argument. This directly returns a singleton, if you would find that useful.

import { getPaystack } from '@stradox/paystack';

const paystack = getPaystack(<your_secret_key>);

const transaction = await paystack.transaction.initialize({
 amount: 10000,
 email: "[email protected]",
});

Methods

The following methods are exposed by the Paystack class:

  • applePay
    • register
    • list
    • unregister
  • bulkCharge
    • initiate
    • listBatches
    • fetchBatch
    • fetchCharges
    • pauseBatch
    • resumeBatch
  • charge
    • create
    • submitPin
    • submitOtp
    • submitPhone
    • submitBirthday
    • submitAddress
    • checkPending
  • customer
    • create
    • list
    • fetch
    • update
    • validate
    • whiteOrBlacklist
    • deactivateAuthorization
  • dispute
    • list
    • fetch
    • listTransactionDisputes
    • update
    • addEvidence
    • getUploadUrl
    • resolve
    • export
  • integration
    • fetchTimeout
    • updateTimeout
  • misc
    • listBanks
    • listCountries
    • listStates
  • paymentPage
    • create
    • list
    • fetch
    • update
    • checkSlugAvailability
    • addProducts
  • paymentRequest
    • create
    • list
    • fetch
    • verify
    • sendNotification
    • requestTotal
    • finalize
    • update
    • archive
  • plan
    • create
    • list
    • fetch
    • update
  • product
    • create
    • list
    • fetch
    • update
  • recipient
    • create
    • bulkCreate
    • list
    • fetch
    • update
    • delete
  • refund
    • create
    • list
    • fetch
  • settlement
    • list
    • listTransactions
  • split
    • create
    • list
    • fetch
    • update
    • addSubaccountSplit
    • removeSubaccountSplit
  • subaccount
    • create
    • list
    • fetch
    • update
  • subscription
    • create
    • list
    • fetch
    • enable
    • disable
    • generateLink
    • sendLink
  • terminal
    • sendEvent
    • fetchEventStatus
    • fetchStatus
    • list
    • fetch
    • update
    • commission
    • decommission
  • transaction
    • initialize
    • verify
    • list
    • fetch
    • chargeAuthorization
    • timeline
    • totals
    • export
    • partialDebit
  • transfer
    • initiate
    • finalize
    • initiateBulk
    • list
    • fetch
    • verify
  • transferControl
    • checkBalance
    • fetchLedger
    • resendOtp
    • disableOtp
    • finalizeDisableOtp
    • enableOtp
  • verification
    • resolveAccount
    • validateAccount
    • resolveBin
  • virtualAccount
    • create
    • assign
    • list
    • fetch
    • requery
    • deactivate
    • split
    • removeSplit
    • fetchProviders

Testing

This package is written in Deno, and so you would need to run the tests in that environment. To run the full test suite (unit and feature tests) locally, you first need to copy the .env.example file to .env and fill in the required environment variables. SECRET_KEY should be a valid Paystack API secret key. You can then run the following command to run the tests:

  $ deno test --env-file --allow-net --allow-env

Alternatively, if you do not wish to use your valid Paystack API credentials, you can run only the unit tests by setting the SECRET_KEY environment variable to a dummy value, and then using the following command:

  $ deno test src/tests/unit --env-file --allow-net --allow-env

Contributing

If you would like to contribute to the project, please fork the repository and submit a pull request. You can also open an issue if you have any suggestions, experience any bugs or have feedback.