Home > Software engineering >  How do you implement payments in React Native 0.70?
How do you implement payments in React Native 0.70?

Time:12-09

How do you implement payments in React Native 0.70. I worked with earlier React Native versions using react-native-credit-card-input and react-native-credit-card-input-plus that are now breaking.

CodePudding user response:

Now it very easy to implement the payment methods in react-native because stripe provide official doc.

They provide a built-in UI for checkout and Card Tokenisation, Here you can Follow Official Doc

1) Setup

install stripe official react-native sdk

yarn add @stripe/stripe-react-native

To initialise Stripe in your React Native app, either wrap your payment screen with the StripeProvider component, or use the initStripe initialisation method.

<StripeProvider publishableKey={PUBLISHABLE_KEY}>
    <Navigation />
 </StripeProvider>

How to get PUBLISHABLE_KEY

Now in your component

Either use the Stripe UI or create your own custom UI for getting card details. In this answer, I'm using rn-credit-card for getting a card, which gives me customization options

  • Related