#falejand
1 messages ยท Page 1 of 1 (latest)
Hi ๐
Do you have the ID for the payment that went through? Or the API request ID that confirmed the payment?
Thanks, taking a look
api req_elE0FaXIhZ8ZgW
This Payment Intent is still in a status of requires_action. 3DS was never attempted from what I can tell
Is there a possibility that react sdk triggered confirmCardPayment() a promise as successful? or at least not with an error before trying to display 3d secure?
we got in our system a success in our flow but it is under 3d secure on stripe side
The request to /confirm the payment was successful (status 200) but that only transitioned the Intent to a status of requires_action.
However, any confirmation request that results in a 3DS authentication would still return a 200, since the HTTP request was successful
that is correct but when using the SDK the promise returned by stripe.confirmCardPayment() should return with an error preventing to continue, is that right?
No that is not correct. Requiring 3DS is still considered a valid confirmation as it moves the Payment Intent to the next status. The confirmation will only return an error if card fails validation or there is some other issue during the confirmation. 3DS is not an error, it is just an additional security step.
The Stripe React plugin should handle displaying the 3D secure interface to the customer though
So they can complete the authentication and move forward with the payment
right, so the promise will be resolved either with an error or success only after displaying the 3d secure dialogue and completing it, is that correct?
Hello! I'm taking over and catching up...
Yeah, when you call stripe.confirmCardPayment it will return a Promise that will resolve with either the successful Payment Intent or an error.
I don't see how this Payment Intent could have resulted in the Promise resolving with the successful Payment Intent, since this Payment Intent has not succeeded.
It's more likely the 3D Secure process started and was abandonded.
Seems like it was abandoned on our end but so far we see that our successful code was triggered, and we are looking for ways to reproduce it. So far we cannot on our QA env but it is happening on prod for our customers using 3d secure, it is not consistent since some customers have the right flow and some customers end up with a successful flow but 3d secure never happened and was requested
We are suspecting that there might be an edge case where the promise is resolved before the 3d dialogue showed up somehow without errors and that triggers or success case
Are you certain you're waiting for the Promise to resolve, and are you checking the status of the result.paymentIntent from the Promise?
this is our code
const result = await controller.confirmCardPayment(
args...
)
if (result && result.error) {
//handle error for user
}
//trigger success flow
In the if statement are you returning to avoid the rest of the code running?
yes
Is it possible that somehow the return isn't being hit?
doesn't seems feasible, it is under if/else condition actually
Regardless, I recommend you wrap your success flow code in if (result && result.paymentIntent) and then have a catch all for some kind of unexpected result where there's no result, or a result with no error and no Payment Intent.
if (result && result.error) {
//handle error for user
} else {
//trigger success flow
}
Oh, yeah, that's probably the issue.
You're not checking for result or result.paymentIntent before proceeding.
Like if there's no result you should not consider that successful.
I see, so this is a better flow per your suggestion
if (result && result.paymentIntent) {
//trigger success flow
} else {
//handle error for user
}
?
That would be better, yes, but I recommend you be more explicit than that.
could you please elaborate on that?
if (result && result.paymentIntent) {
//trigger success flow
} else if (result.error) {
//handle error for user
} else {
// This should never happen, but throw an error and log details so you can investigate this
}
oh that sounds perfect and more clear, we are going to give it a try and see if that resolves our issue
Make sure you add some good logging for each case so you get clear details about what might be happening.
do you know in which case our current code will fail? We want to try to reproduce on our QA/Dev env but so far we have not been successful
I'm guessing the Promise is being canceled or is timing out or something, which results in no result at all, which would trigger your success code. Maybe try triggering 3D Secure and then leave it there for a while and see what happens?
I didn't think there was, but there might be depending on specific circumstances.
It could also be that other code somewhere is timing out and canceling the process.
I see, you mean on stripe sdk?
No, I mostly meant elsewhere on the page. It's also possible the card issuer itself times out, but I would expect that to produce a result.error when the Promise resolves.
if it is helpful this is one 3d secure that was fine
Successful 3ds
pi_3NvR0hLOi0aPhhJQ1cXGJQuP
req_w4LWQTy6fuYx1q
and this we had issues
pi_3NbhDZLOi0aPhhJQ0R0as01Z
req_elE0FaXIhZ8ZgW
Do you see any anomaly that we perhaps are not contemplating?
First one looks normal, nothing stands out to me. But that's expected since it succeeded.
The second one just stops after confirmation is attempted. Seems like abandonment to me.
yeah second is abandoned but succeeded in our logic
thx very much we will try to reproduce and change the code to see if the issue is solved for our customers
๐
Happy to help! Good luck with it!
We just checked and perhaps timeout might not be the problem there were 2 seconds between requires_action and promise completing and triggered successful flow
Hm, that's not what I would expect, but hopefully the adjusted handling and logging will provide more details.