#Gadbit - RN initialize stripe
1 messages · Page 1 of 1 (latest)
We have our Accept a Payment guide available for React Native.
https://stripe.com/docs/payments/accept-a-payment?platform=react-native
The Stripe Initialization step is what I think you're looking for:
https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#stripe-initialization
Gadbit - RN initialize stripe
Yes. I've instantiated like that. However, i want to charge my customers for subscriptions and enable them to accept payments in my app (Stripe Connect)
So, i can't use Stripe Provider globally.
I need to instantiate stripe with my PK in one screen. But i also need to instantiate Stripe with connectedAccount id in other screen.
So i would like to know what do i need to import in my js file in order to use Stripe('pk_asdfg'); in React Native
In that case you would want to defer instantiation until you need to accept payment. For all instances
Yeah, but i need to know what shoud i importin React Native
For example...
I need to import import { StripeProvider } from '@stripe/stripe-react-native';
In order to use StripeProvider
Hi, stepping in as snufkin had to step away. You would still use the Stripe Provider, you would use it to only wrap the payment portion of your code. Like so:
<StripeProvider publishableKey="pk_test_XXXXXX" urlScheme="your-url-scheme" // required for 3D Secure and bank redirects merchantIdentifier="merchant.com.{{YOUR_APP_NAME}}" // required for Apple Pay > // instead of whole app, just the payment forms go here </StripeProvider>
So, how can i set the Connected Account ID?
All of our Connect documentations should have React Native samples so I'd highly recommend going through our documents.
https://stripe.com/docs/connect/enable-payment-acceptance-guide
It only has refs for Web, Android, iOS
That is my bad, I should have shared an example here: https://stripe.com/docs/connect/collect-then-transfer-guide?platform=react-native&ui=payment-sheet