#Barasinga
1 messages · Page 1 of 1 (latest)
Can you share the code that results in that error?
{"code": "Failed", "declineCode": null, "localizedMessage": "Invalid Payment Intent client secret: sk_test_51LrcmXXXXX", "message": "Invalid Payment Intent client secret: sk_test_51LrcmFGPzB0sOwRzYFBPWYtT7aOp2E0MWMDofbuWvfdeSnvZXXXXXXXXX", "stripeErrorCode": null, "type": null}
sk_test_xxx is not a Payment Intent client secret
That's your API secret key
What are you trying to do?
We have a react native mobile app and we are trying to use stripe payment page for card processing. Idea is that the user enters the card details and we obtain a token from stripe to save on our server for future payments
Ok, so you're following this guide: https://stripe.com/docs/payments/accept-a-payment?platform=react-native
Your backend should create a Payment Intent, and return the client_secret field to your RN app. That's what you use to initialise the Payment Sheet: https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-collect-payment-details
So our app should first communicated with our backend to obtain the client_secret then we will use this in the payment intent to send to stripe server?
Correct
No, your backend will create the Payment Intent via the Stripe API and then return the response to your React Native app