Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PayPal] Fixed bug with currency code not found #653

Merged
merged 1 commit into from
Oct 7, 2016

Conversation

patrickbussmann
Copy link
Contributor

Hey guys,

I'm getting this error while using the ionic-native PayPal plugin.

PayPal SDK: PayPalPayment not processable: Currency code is required.

I'm using this code:

PayPal.init({
  "PayPalEnvironmentProduction": "YOUR_PRODUCTION_CLIENT_ID",
  "PayPalEnvironmentSandbox": "YOUR_SANDBOX_CLIENT_ID"
}).then(() => {
  let payment = new PayPalPayment('1.23', 'EUR', 'Charge money', 'intent');
  PayPal.renderSinglePaymentUI(payment).then((s) => {
    console.log('SUCCESS RENDER INIT', s);
  }, (e) => {
    console.log('ERROR RENDER INIT', e);
  });
}, (e) => {
  console.log('ERROR PAYPAL INIT', e);
});

Explanation of this issue:
The PayPal-Cordova-Plugin uses the currency from the array instead currencyCode so that this can never work. See https://github.com/paypal/PayPal-Cordova-Plugin/blob/master/src/ios/PayPalMobileCordovaPlugin.m#L97

The official JS file says the same. See https://github.com/paypal/PayPal-Cordova-Plugin/blob/master/www/paypal-mobile-js-helper.js#L49

After this change it works fine 👍

@ihadeed
Copy link
Collaborator

ihadeed commented Oct 7, 2016

Thanks for the fix @patrickbussmann !

@ihadeed ihadeed merged commit 598f8a9 into danielsogl:master Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants