Communicate with the Paystack API to initialize transaction, create plans, etc.
$ npm install machinepack-paystack --save
// Initialize a transaction on your Paystack integration
const Paystack = require('machinepack-paystack')
Paystack.initializeTransaction({
apiKey: process.env.PAYSTACK_API_KEY,
email: '[email protected]',
amount: '20000'
}).exec(function (error, intializedTransaction) {
console.log(initializedTransaction)
})
machinepack-paystack
expects your Paystack secret for convenience to be in your environment as PAYSTACK_API_KEY
so the above can be written as:
// Initialize a transaction on your Paystack integration
const Paystack = require('machinepack-paystack')
Paystack.initializeTransaction({
email: '[email protected]',
amount: '20000'
}).exec(function (error, intializedTransaction) {
console.log(initializedTransaction)
})
To run the test in this machine, rename env.example
to .env
then replace the content with your Paystack test API Key
Now run test simpley with:
npm test
Alternatively you can run tests by
PAYSTACK_API_KEY_FOR_TESTS=YOUR_PAYSTACK_TEST_API_KEY npm test
Thanks goes to these wonderful people (emoji key):
Omereshone Kelvin 🚇 |
haastrup elijah 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!