Skip to content

About

Paystack SDK written in Typescript for development on edge and serverless servers

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Paystack SDK (Edge)

Why Another Paystack Package?

Other packages are either outdated or don't support TypeScript or only works with Node.js. This package is built with TypeScript and works with any JavaScript environment.

Installation

For Yarn:

yarn add paystack-edge-sdk

For NPM:

npm install paystack-edge-sdk

Usage

For TypeScript:

import { Paystack } from 'paystack-edge-sdk';

const paystack = new Paystack("secret_key");

For JavaScript:

const Paystack = require('paystack-edge-sdk').Paystack;
const paystack = new Paystack('secret_key');

OR

const { Paystack } = require('paystack-edge-sdk');
const paystack = new Paystack('secret_key');

All methods use promises, meaning you can either use async...await, then...catch, or try...catch.

Example

import { Paystack } from 'paystack-edge-sdk';

const paystack = new Paystack("secret_key");

const { data: transaction, error } = await paystack.transaction.initialize({
  amount: 10000,
  email: "email@example.com",
});

if (error) {
  console.error(error);
} else {
  console.log(transaction);
}

Modules

  • Apple Pay
  • Bulk Charges
  • Charge
  • Customer
  • Dedicated Virtual Accounts
  • Invoice
  • Payment Page
  • Plan
  • Product
  • Recipient
  • Refund
  • Settlement
  • SubAccount
  • Subscription
  • Transaction
  • Transaction Split
  • Transfer
  • Verification
  • Control Panel
  • Disputes
  • Miscellaneous

Contributing

If you notice a missing function or a bug, please feel free to submit a PR. You will need to fork the repo and create a PR against it with your changes.
Thank you! 😄

About

Paystack SDK written in Typescript for development on edge and serverless servers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages