#twafiq_code
1 messages ยท Page 1 of 1 (latest)
๐ 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.
Can you paste those req_xxx IDs here please
Screenshots aren't really helpful in this case
What's 'pst'?
Yeah just no idea what 'PST' meant. I'll take a look soon
the failing get payment intent is always using a pst_live... api key
i think it means publishable key
Yeah sorry you just flooded me with screenshots that all looked very similar
Sorry
Also, this doesn't happen everytime I retrieve a payment intent.
It's very random
Can you share the value of clientSecret from the code snippet you shared?
for the failing retrieve payment intent?
It's only ever sent in req_0BktmRBFWHgmtn. That param is omitted in the other two
clientSecret,```
It's just the payment intent id that I pass in
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 ๐
It should be the client_secret of the intent: https://docs.stripe.com/api/payment_intents/object#payment_intent_object-client_secret
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
pi_abc_secret_xyz
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>
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
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
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
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
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
Where can i get the client secret of a payment intent
in the object itself, similar to the id?
Yes, I just linked to that
Great!
Glad that fixed things for you
Yes as I expect it's likely only utilised in certain scenarios
Which error?
The client_secret provided does not match the client_secret associated with the PaymentIntent.
Share the req_xxx ID please
hi! I'm taking over this thread. let me know when you fing the ID
then can you share the PaymentIntent ID and the client_secret you are using?
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)
}
}
)
Returning PaymentIntent: pi_3RKoKvA5TqGV3t5q0G9v6Phj client secret: pi_3RKoKvA5TqGV3t5q0G9v6Phj_secret_GCcdhUvn6VCVdPTQjdHv4whtN for 15dc6a00-abd3-44c5-9993-c69a6a529035.
All the get requests for the payment intent id seem to be 200
I think I found the request: https://dashboard.stripe.com/logs/req_cBYV4sdci08fMV
not sure if that's expected since the retrieve method is failing
Cool
although that request looks a little old
i am calling this function right now and it is still failing
I don't see a more recent errors on that account
are you making using a different Stripe account?
no same account
Hey ther,e just stepping in for soma who needs to step away