#twafiq_code

1 messages ยท Page 1 of 1 (latest)

pearl sundialBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1369275147177037874

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

hollow topaz
placid merlin
#

Can you paste those req_xxx IDs here please

#

Screenshots aren't really helpful in this case

hollow topaz
#

Failing with pst: req_0BktmRBFWHgmtn

#

Passing with pst: req_Sne5i4tqZaUwlb

placid merlin
#

What's 'pst'?

hollow topaz
#

Passing with sk_live key: req_ui8vr5ocVGTngm

#

the api key

#

check the screenshots

placid merlin
#

Yeah just no idea what 'PST' meant. I'll take a look soon

hollow topaz
#

the failing get payment intent is always using a pst_live... api key

#

i think it means publishable key

placid merlin
#

pss_live_xxx you mean

#

Ah I see

#

Hang on

hollow topaz
placid merlin
#

Yeah sorry you just flooded me with screenshots that all looked very similar

hollow topaz
#

Sorry

#

Also, this doesn't happen everytime I retrieve a payment intent.

#

It's very random

placid merlin
#

Can you share the value of clientSecret from the code snippet you shared?

hollow topaz
#

for the failing retrieve payment intent?

placid merlin
#

It's only ever sent in req_0BktmRBFWHgmtn. That param is omitted in the other two

placid merlin
hollow topaz
#

It's just the payment intent id that I pass in

placid merlin
#

Right, but I want to see the actual value (we don't log them). I suspect it's just the wrong value and this happens intermittently due to an integration issue

#

Also, it i's the ID then that's probably the issue ๐Ÿ˜…

#

pi_abc_secret_xyz

hollow topaz
#

For this case the client_secret is the payment intent id.

I don't have the logs on my end anymore but whenever the retrievePaymentIntent would fail, the request would look like:
https://api.stripe.com/v1/payment_intents/<payment_intent_id>?client_secret=<payment_intent_id>

placid merlin
#

For this case the client_secret is the payment intent id.
Well then that explains it

#

You're passing the wrong property to the param

hollow topaz
#

but successful retrievals would look like:
https://api.stripe.com/v1/payment_intents/<payment_intent_id>

i.e. with no client secret in the request.

The issue is why does stripe sometimes send these different request formats even though i not changing anything

placid merlin
#

Well in the other requests the client_secret param isn't even set. I'd guess that's just an implementation detail of the SDK and it's only used certain times for security puroposes

#

But you just need to pass the correct property and this isn't an issue

hollow topaz
#

The issue only recently started happening. Previously, I was always able to retrive the payment intent via its id. Now sometimes the id works, and sometimes it requires the actual client secret

placid merlin
#

I just explained why, right? You can see from those requests shared that sometimes the client_secret isn't even set at all, which means this error wouldn't even be triggered in those cases

#

Please just pass the correct property to the clientSecret param

hollow topaz
#

Where can i get the client secret of a payment intent

#

in the object itself, similar to the id?

hollow topaz
#

Ok thank you

#

trying it now

#

Cool its working

placid merlin
#

Great!

hollow topaz
#

Just wanted to show you the requests

placid merlin
#

Glad that fixed things for you

hollow topaz
#

Sometimes the client_secret param is not present

#

Is this a security feature?

pearl sundialBOT
placid merlin
#

Yes as I expect it's likely only utilised in certain scenarios

hollow topaz
#

Hmm ok

#

Still getting this error

placid merlin
#

Which error?

hollow topaz
#

The client_secret provided does not match the client_secret associated with the PaymentIntent.

placid merlin
#

Share the req_xxx ID please

hollow topaz
#

The error is not showing up in the stripe dashboard

#

gimme a sec

river pecan
#

hi! I'm taking over this thread. let me know when you fing the ID

hollow topaz
#

ok

#

The requests are showing up with a 200 code on the dashboard

river pecan
#

then can you share the PaymentIntent ID and the client_secret you are using?

hollow topaz
#

but the on failure callback is being triggered in my code

                terminalInstance.getInstance().retrievePaymentIntent(
                    clientSecret,
                    object : PaymentIntentCallback {
                        override fun onSuccess(paymentIntent: PaymentIntent) {
                            Log.d(logTag, "PaymentIntent retrieved successfully: $paymentIntent")
                            continuation.resume(paymentIntent)
                        }

                        override fun onFailure(e: TerminalException) {
                            Log.e(logTag, "Failed to retrieve PaymentIntent: ${e.message}")
                            handlePaymentError(PaymentError.ProcessingError("Failed to retrieve payment details", e))
                            restartApplication(appContext)
                        }
                    }
                )
hollow topaz
#

All the get requests for the payment intent id seem to be 200

river pecan
hollow topaz
#

not sure if that's expected since the retrieve method is failing

hollow topaz
#

although that request looks a little old

#

i am calling this function right now and it is still failing

river pecan
#

I don't see a more recent errors on that account

#

are you making using a different Stripe account?

hollow topaz
#

no same account

pearl sundialBOT
thorn sparrow
#

Hey ther,e just stepping in for soma who needs to step away