-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Hi,
i am new to cordova and its development. I am having an issue with window.PaystackPlugin.chargeCard, my app is throwing the error of charge failed:[object Object]
My Code:
/* my form object */
var orderObj = {
myemail: email,
amount: amt,
firstname: fname,
lastname: lname,
password: password
};
var posting = $.post( 'https://mysite.com/insert.php', orderObj );
posting.done(function(data) {
alert(data);
/* check result from the attempt */
payWithPaystack(data);
});
function payWithPaystack(data){
(
window.PaystackPlugin.chargeCard(
function(resp) {
// charge successful, grab transaction reference - do your thang!
console.log('charge successful: ', resp);
alert("charged:" + resp);
},
function(response) {
// Something went wrong, oops - perhaps an invalid card.
console.log('charge failed: ', resp);
alert("charge failed:" + resp)
},
{
cardNumber: '507850785078507812',
expiryMonth: '08',
expiryYear: '21',
cvc: '081',
email: 'customer@email.yahoo',
amountInKobo: 90000,
});
alert(window.PaystackPlugin);
}
So the alert(window.PaystackPlugin); gives [object Object] error