Paystack command line
A simple CLI tool that makes Paystack easier for developers to intergrate. It outputs a file that interacts with Paystack APIs as well as its minified version if requested.
npm i paystack-cli -g
The above command will display the neccesary infomation and its usage
--help shows the usage
--version shows the version
create with necessary arguments will ask for Paystack Public Key and then create the necessary file as well as its minified version if optional
min argument is provided.
inline to output the paystack-inline.js file which contains necessary codes for Paystack Inline
embed to output the paystack-embed.js file which contains necessary codes for Paystack Inline Embed
paystack-js to output the paystack.js file which contains necessary codes for Paystack Js
paystack-cli c inline
will output the inline file
paystack-cli create embed
will output embed file
min to minify any of the produced outputs
paystack-cli create embed min
File Usage and JQuery IDs
Please make sure to use the following JQuery IDs in order to interact with the outputed file.
for those that want to use paystack as inline. Paystack UI will pop up as a modal
<!-- import necessary scripts here --><!-- The following IDs must be included inyour html file (Note that they can be anywhereaccording to your choice.) -->Pay
for those want to use paystack as embeded frame. Paystack UI will be loaded in a container on your page
<!-- import necessary scripts here --><!-- include this line to initialize Paystack --><!-- The following IDs and onclick attribute must beincluded in your html file (Note that they can be anywhereaccording to your choice.) -->Pay<!-- Please include this at the bottom of the html file -->
for those that want to write custom code with Paystack. Payment will have to be initialized first from the server and access code will be used. You can check Initailize Page to get the grasp of how it is done.
<!-- import necessary scripts here --><!-- You will have to initialize the transaction before anything.After initialization, Paystack API will respond with anaccess-code which must be passed to #access_code as a text --><!-- You can either visitto get a grasp of how this can be done with cURL and you can as welldo this in any server-side language of your choice--><!-- The following data-paystack must beincluded in your html file (Note that they canbe anywhere according to your choice.) -->Submit<!-- if pin is requested, you can pass the PIN to #card_pin from a form --><!-- OTP form -->Submit
#customer-email is an ID of the input form which will accepts the email of the user or the card owner.
#amount is an ID of the input form that accepts the amount to be charged from the card.
#success-response is an ID that listens to a text which inform that the transaction was successful.
#mobile-number is an ID of the input form that accepts the mobile number of the user.
#access_code is the ID of a text that passes the access code which will be programatically generated by you. Please note that the access code can only be used once.
#card_pin is the ID of the input form that accepts card PIN.
#OTP is the ID of the input form that accepts the OTP sent to phone.