Closed darmie closed 8 years ago
Please check that your android config in your config.xml
file is inserted within <platform>
tags as shown below, build
your app again and try to use the plugin again:
<platform name="android">
<config-file target="AndroidManifest.xml" parent="application">
<meta-data android:name="co.paystack.android.PublishableKey" android:value="INSERT-PUBLIC-KEY-HERE"/>
</config-file>
</platform>
That solved it. Thanks.
The token is being created but it doesn't return as a value in the Javascript success call back
05-19 14:43:13.280: I/PaystackPlugin(11213): PSTK_17ejvt040djfepr
05-19 14:43:13.290: I/chromium(11213): [INFO:CONSOLE(121)] "Paystack success: ", source: file:///android_asset/www/js/controllers.js (121)
Leave out the JSON.stringify()
function to see what format the plugin response comes through first, then you can add it back on subsequently. Both the success and error callbacks return objects.
$scope.newCard = function(){
window.PaystackPlugin.getToken(
function(resp) {
// A valid one-timme-use token is obtained, do your thang!
console.log('Paystack success: ', resp);
//$scope.listCards()
},
function(resp) {
// Something went wrong, oops - perhaps an invalid card.
console.log('Paystack failure: ', resp);
},
$scope.cardDetails.number,
$scope.cardDetails.month.getMonth(),
$scope.cardDetails.month.getFullYear(),
$scope.cardDetails.cvv);
};
Yes I have removed it and the result is still the same.
Ensure you are calling the plugin within a normal Cordova deviceready
or Ionic's Platform.ready()
event just to prevent any race condition. Then always recompile your app when you make changes to your code using a plugin by running build
again.
The second argument resp
in console.log("Paystack success ", resp)
is being ignored b chromium.
this is how i got to see the response from the call back console.log("Paystack success " + resp)
, using the +
sign
Ok, glad you figured it out. You may try console.log(resp)
alone anyway, most likely you'd be assigning the token to a local variable after all. Cheers!
Sure!
This is my config.xml
I am getting this error when I tried to use paystack
My Code