stripe for expo (react native)

Viewed 18

I am working on a mobile app based on expo (react-native) and I need double check if the mobile device supports apple payment. I found a library for stripe payment system @stripe/stripe-react-native and there are files that return method isApplePaySupported - true/false.

I need to use that method without installing that package and I have tried to extract the code which does that validation - I see that declaration of that method in that file node_modules@stripe\stripe-react-native\src\NativeStripeSdk.tsx but I cant find implementation. I mean the code which I can run and get the same response with that isApplePaySupported method.

I do not have big experience in structure of those react modules, but I check all files and can find the only declaration without implementation of that code. Can someone help me?

1 Answers

To rewrite this function yourself, you'll have to write code that interfaces with native components, specifically PassKit.

My recommendation would be to just install that ReactNative SDK from Stripe and use its functions as it does everything you need it to. Especially if you're taking payments with Apple Pay, you need to run the payment through some payment provider, so if you're using Stripe then you need to use Stripe's SDK to actually accept a payment.

Related