
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
adonisjs-paystack
Advanced tools
An addon/plugin package to provide PayStack payment services in AdonisJS 4.1+
An addon/plugin package to provide PayStack payment services in AdonisJS 4.1+
Install from the NPM Registry
$ adonis install adonisjs-paystack
Make use of it inside a HTTP/Web Socket Controller(s)
const Paystack = use('PayStack')
/**
* This class handles all requests for
* the checkout flow of the app
*
* @class CheckOutController
*/
class CheckOutController {
/**
* Begin Transaction Process
*
* @method initTransaction
*
* @param {Object} context.request
* @param {Object} context.response
*
* @return {Promise}
*/
async initTransaction({ request, response }) {
//.....
try {
let paystackResponse = await Paystack.initializeTransaction({
callback_url:"https://locahost:3333/trans/hooks/paystack",
amount: 3000,
email: "xyz@abc.com"
})
}catch(ex){
console.error(ex.message);
return response.status(400).json({
data: null,
error: true,
message: ex.message
});
}
return await response.status(200).json({
data: response.body.data
});
}
async fetchCustomer({ request, response }){
//.....
try {
let paystackResponse = await Paystack.getCustomer({
customer_id:'CUS_reu3738we993wsnqah'
});
}catch(ex){
console.error(ex.message);
return response.status(400).json({
data: null,
error: true,
message: ex.message
});
}finally{
return response.status(200).json({
data: response.body.data
})
}
}
}
module.exports = CheckOutController
It's possible to fake the
PayStack
instance like so:
const PayStack = use('PayStack')
//start faking the provider instance
PayStack.fake()
//stop faking the provider instance
PayStack.restore()
MIT
npm i
npm run lint
npm run test
See the CONTRIBUTING.md file for info
Coolcodes is a non-profit software foundation (collective) created by Oparand - parent company of StitchNG, Synergixe based in Abuja, Nigeria. You'll find an overview of all our work and supported open source projects on our Facebook Page.
Follow us on facebook if you can to get the latest open source software/freeware news and infomation.
Does your business depend on our open projects? Reach out and support us on Patreon. All pledges will be dedicated to allocating workforce on maintenance and new awesome stuff.
FAQs
An addon/plugin package to provide PayStack payment services in AdonisJS 4.1+
We found that adonisjs-paystack demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.