Taracque / cordova-plugin-braintree

:credit_card: A Cordova plugin for the Braintree mobile payment processing SDK.
MIT License
27 stars 42 forks source link

Paypal not opened on Android when package name has uppercase characters #56

Open dvcroft opened 6 years ago

dvcroft commented 6 years ago

When I choose PayPal as a payment option, the payment UI disappears and I get an error, "Result was not RESULT_CANCELED, but no PaymentMethodNonce was returned from the Braintree SDK"

Fortunately I've identified the cause and a hack to verify the solution, but I don't know enough about plugins to contribute a fix.

My application bundle id has upper and lower case characters. From the braintree docs, the android xml must include com.your-company.your-app.braintree with no underscore and in all lowercase. see https://developers.braintreepayments.com/guides/client-sdk/setup/android/v2#browser-switch-setup

I edited the following files: platforms/android/android.json plugins/cordova-plugin-braintree/plugin.xml

and replaced the ${applicationId}.braintree with [my bundle name hardcoded in lowercase].braintree

I then manually deleted the original activity with the applicationId from platforms/android/AndroidManifest.xml

When I rebuild, the hardcoded entry is added to AnrdoidManifest.xml, and when run I get the paypal screen as expected.

I haven't tried this on IOS yet, but suspect I may have a similar problem there.

Thanks for creating and maintaining this plugin!

codinronan commented 6 years ago

Wow that's... that's amazing. Just ran into this. Thanks!

sumitkumar991 commented 6 years ago

Ran into the same issue, then changed the package name to all small letters and it started working. Many thanks for this.