paystack-simple
<1kb Framework/Library agnostic paystack wrapper
INSTALLATION
npm install paystack-simple
USAGE
Basic Usage
import Paystack from "paystack-simple";
const paymentInstance = Paystack();
paymentInstance.init()
paymentInstance.addOptions({
amount: 5000,
key: 'pk-xxxxx-xxxxxx',
email: 'cutomeremail@mail.com',
})
paymentInstance.addOptions({
currency: 'NGN',
callback: (res) => {
}
})
paymentInstance.pay()
Embed
import Paystack from "paystack-simple";
const paymentInstance = Paystack();
paymentInstance.init()
paymentInstance.addOptions({
amount: 5000,
key: 'pk-xxxxx-xxxxxx',
email: 'cutomeremail@mail.com',
})
paymentInstance.addOptions({
container: 'container-ID',
callback: (res) => {
}
})
paymentInstance.pay()
Set GlobalConfig
import Paystack, { setGlobalConfig } from "paystack-simple";
setGlobalConfig({ key: 'pk-test-xxxx-xxxx' })
paymentInstance.addOptions({
amount: 5000,
email: 'cutomeremail@mail.com',
callback: (res) => {
}
})
paymentInstance.pay()
What's Cool?
- Less than 1kb
- Framework/Library agnostic
- Simple API
- Intellisense support