This is a wrapper that is used to make it easy to interface with Paystack API.
npm
npm i paystack-gateway
yarn
yarn add paystack-gateway
Apart from the example below, other examples can be found inside real-sample
import Paystack from "paystack-gateway-test"
const paystackInstance = new Paystack(process.env.SECRET_KEY) // secret key should be passed
// Get transactions
const queryParams = {
perPage: 20
}
const transactions = await paystackInstance.transactions.list({ queryParams })
// Initialize transactions
const bodyParams = {
email: "[email protected]",
amount: 20000,
currency: "ZAR"
}
const initializedTransaction = await paystackInstance.transactions.initialize({ bodyParams: bodyParams })