Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ const fs = require("fs"),
let newPaystack = (old = String, recent = String, type, min)=>{
if(type == "paystack-js"){
fs.writeFile(`${recent}.js`, old, 'utf8', err => {
if (err) return console.log(err);
if (err) {
console.error('Error writing file:', err);
return;
}
console.info(`Successfully created "${recent}.js"`)
});

console.info("Done!!!")
console.info('Please check directory for "paystack.js"')

if(min == "min"){
minify(`${recent}.js`)
Expand All @@ -38,11 +39,12 @@ let newPaystack = (old = String, recent = String, type, min)=>{


fs.writeFile(`${recent}.js`, result, 'utf8', err => {
if (err) return console.log(err);
if (err) {
console.error('Error writing file:', err);
return;
}
console.info(`Successfully created "${recent}.js"`)
});

console.info("Done!!!")
console.info(`Done. Please check directory for "${recent}.js"`)

if(min == "min"){
minify(`${recent}.js`)
Expand All @@ -67,8 +69,8 @@ let newPaystack = (old = String, recent = String, type, min)=>{
}

program
.version('1.2.0')
.description('A simple CLI tool that makes paystack easier for developers to intergrate');
.version('1.2.3')
.description('A simple CLI tool that makes paystack easier for developers to integrate');

program
.command('create <type> [min]')
Expand Down
4 changes: 2 additions & 2 deletions model/oldPaystack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = {
PaystackPop.setup({
key: 'the-public-key',
email: $("#customer-email").val(),
amount: parseInt($("#amount").val())+"00",
amount: parseInt($("#amount").val() * 100),
container: 'paystackEmbedContainer',
callback: function(response){
$("#success-response").text('success. transaction ref is ' + response.reference)
Expand All @@ -18,7 +18,7 @@ module.exports = {
var handler = PaystackPop.setup({
key: 'the-public-key',
email: $("#customer-email").val(),
amount: parseInt($("#amount").val()) + "00",
amount: parseInt($("#amount").val() * 100),
currency: "NGN",
// ref: ''+Math.floor((Math.random() * 1000000000) + 1), // generates a pseudo-unique reference. Please replace with a reference you generated. Or remove the line entirely so our API will generate one for you
metadata: {
Expand Down
2 changes: 1 addition & 1 deletion model/questions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
{
type : 'input',
name : 'public_key',
message : 'Enter your Paystack Pubic Key:'
message : 'Enter your Paystack Public Key:'
}
],
confirm : [
Expand Down