Created
November 1, 2016 13:38
-
-
Save subomi/67103133a9ba2ed0fe1613641a2edc19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makepayment(key, email, amount, ref, callback) { | |
var handler = PaystackPop.setup({ | |
key: key, // This is your public key only! | |
email: email || 'customer@email.com', // Customers email | |
amount: amount || 5000000.00, // The amount charged, I like big money lol | |
ref: ref || 6019, // Generate a random reference number and put here", | |
metadata: { // More custom information about the transaction | |
custom_fields: [ | |
{} | |
] | |
}, | |
callback: callback || function(response){ | |
let div = document.getElementsByTagName("div")[0] | |
div.innerHTML = "This was the json response reference </br />" + response.reference; | |
}, | |
onClose: function(){ | |
alert('window closed'); | |
} | |
}); | |
// Payment Request Just Fired | |
handler.openIframe(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment