#kaushal-gpay
1 messages · Page 1 of 1 (latest)
getting this error for paymentIntent
Invalid Payment Intent client secret: "pi_3Lg3CcGfgz2J4wP21kyn35eo_secret_FtGdBAEmLluoedSBwTSMoZxy9")
what might cause this issue ?
might be caused by using the wrong publishable key in your app(if it doesn't come from the same Stripe account that created the PaymentIntent).
oh
I am getting the publishable key from my backend API and intialising the PaymentConfiguration , then i get the clientSecret from another API call then using that secret to do presentForPaymentIntent(clientSecret)
then its saying the above said error
Hi! I'm taking over this thread.
hey, ya
You have two keys:
- Sercet key that created the PaymentIntent (
sk_xxx) - Publishable key that confirm the PaymentIntent (
pk_xxx)
You need to double check that both of these keys come from the same Stripe account
And you can check your keys here in the dashboard: https://dashboard.stripe.com/test/apikeys
so secret key will be in this format - (sk_xxx) ?
not like this - pi_3Lg3CcGfgz2J4wP21kyn35eo_secret_FtGdBAEmLluoedSBwTSMoZxy9 ?
I dont have access to stripe account to check
You are confusing two things:
- Stripe secret key (
sk_xxx), there is only one per account, and it's used to make API calls from the backend - Client secret (
pi_xxx_secret_xxx), there is one for each PaymentIntent, and it's used to collect the payment details on the frontend
ah ok
I will cross with my team, but before that this same approach is working for IOS apple pay at the moment, client secret is fine for them
the stripe account is in UK, i am trying to test in TEST Environment in my phone from India, is that creating a problem, can you tell me ?
The error message is about your client secret, so that is the issue. Your environment or country are not relevant here.
okay, thanks