react-native-payments icon indicating copy to clipboard operation
react-native-payments copied to clipboard

Tokenizing Apple Pay

Open GFean opened this issue 3 years ago • 3 comments

Hi there, I couldn't find a correct way to tokenize my apple pay payment, so I can get the payment nonce in the end. If I pass 'braintree' as gateaway, it says that it's not supported. Any help please ?

GFean avatar Apr 03 '21 01:04 GFean

I didn't try with braintree but I just got it working with Stripe. And initially I had same problem - message saying its not linked.

The trick is that it only works with the gateway if it can resolve in objective c import <Stripe/Stripe.h> (and analogically for Braintree) so you need to take care that that library is installed and importable.

Actually the podspec of this package lists Stripe and Braintree as dependencies so you'd think it ought to work. However problem with Stripe is that it's newest version is for swift only and doesnt seem to offer header files for objective c. The fix was to force older version of Stripe pod in Podfile of my project. I used the latest from major 19 and it worked.

Similar issue may be true for Braintree. Try forcing an older version of Braintree. You can browse on ios/Pods/Braintree to see if it ships with swift files or objective c files.

Good luck and please pay it forward!

kowalski avatar Apr 07 '21 19:04 kowalski

Hi there, sorry I didn't notice your answer. Thanks a lot for your attention ! I've fixed this issue by sharing the same interface from react-native-dropin-ui, since I'm also using this package I've included braintree module from there in gatewaymanager and made some other modifications and it has worked for me. If someone's interested, you can check my forked version of this package on my Github Page.

GFean avatar Apr 14 '21 00:04 GFean

Hi both, just seen this discussion. Really helpful to know that Stripe has to be locked to a specific version. I'll fix this in the podspec 👍

nabilfreeman avatar May 25 '21 10:05 nabilfreeman