#kaushal-gpay

1 messages · Page 1 of 1 (latest)

hollow glacier
#

hi! what's the issue exactly?

primal jewel
#

getting this error for paymentIntent
Invalid Payment Intent client secret: "pi_3Lg3CcGfgz2J4wP21kyn35eo_secret_FtGdBAEmLluoedSBwTSMoZxy9")

#

what might cause this issue ?

hollow glacier
#

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).

primal jewel
#

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

merry berry
#

Hi! I'm taking over this thread.

primal jewel
#

hey, ya

merry berry
#

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
primal jewel
#

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

merry berry
#

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
primal jewel
#

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 ?

merry berry
#

The error message is about your client secret, so that is the issue. Your environment or country are not relevant here.

primal jewel
#

okay, thanks