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.
For Yarn:
yarn add paystack-edge-sdkFor NPM:
npm install paystack-edge-sdkFor 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.
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);
}- 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
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! 😄