Zein
Zein

Reputation: 577

Stripe not working with live publishableKey React Native

In my Stripeprovider in App.js I was using the publishable test key with no issues everything was working pretty well, when I changed it to the live key stripe ( I also changed the secret on the backend) loads for split second then closes without any intent made on stripe dashboard.

<StripeProvider
  publishableKey={secret}
  ...
>
.
.
.
</StripeProvider>

Upvotes: 0

Views: 683

Answers (2)

Dako Junior
Dako Junior

Reputation: 747

try this step

  1. Be sur the publishable key is in your front and you secret key in your back.

  2. Be sur you use the compatible key ( pk_test_XXX front & sk_test_XXX back) OR ( pk_live_XXX front & sk_live_XXX back)

  3. Be sur you return the good things from your endpoints

In my case, what i did wrong, i returned the wrong publishableKey from the back.

I'm using the Composant Element & the hooks

const {initPaymentSheet, presentPaymentSheet} = useStripe();

You have the documentation from stripe of what you need to return from the back here

https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet

Upvotes: 0

os4m37
os4m37

Reputation: 1133

You probably need to follow these steps in order to go live if you are willing to use Google Pay: https://stripe.com/docs/google-pay?platform=react-native#going-live-react-native

Upvotes: 0

Related Questions