#falejand

1 messages ยท Page 1 of 1 (latest)

spice surgeBOT
desert mango
#

Hi ๐Ÿ‘‹

Do you have the ID for the payment that went through? Or the API request ID that confirmed the payment?

leaden hazel
#

you mean payment intent id?

#

pi_3NbhDZLOi0aPhhJQ0R0as01Z

desert mango
#

Thanks, taking a look

leaden hazel
#

api req_elE0FaXIhZ8ZgW

desert mango
#

This Payment Intent is still in a status of requires_action. 3DS was never attempted from what I can tell

leaden hazel
#

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

desert mango
#

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

leaden hazel
#

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?

desert mango
#

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

leaden hazel
#

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?

spice surgeBOT
frail rivet
#

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.

leaden hazel
#

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

frail rivet
#

Are you certain you're waiting for the Promise to resolve, and are you checking the status of the result.paymentIntent from the Promise?

leaden hazel
#

this is our code

const result = await controller.confirmCardPayment(
args...
)

  if (result && result.error) {
    //handle error for user
 }

//trigger success flow

frail rivet
#

In the if statement are you returning to avoid the rest of the code running?

leaden hazel
#

yes

frail rivet
#

Is it possible that somehow the return isn't being hit?

leaden hazel
#

doesn't seems feasible, it is under if/else condition actually

frail rivet
#

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.

leaden hazel
#

if (result && result.error) {
//handle error for user
} else {
//trigger success flow
}

frail rivet
#

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.

leaden hazel
#

I see, so this is a better flow per your suggestion

if (result && result.paymentIntent) {
//trigger success flow
} else {
//handle error for user
}

#

?

frail rivet
#

That would be better, yes, but I recommend you be more explicit than that.

leaden hazel
#

could you please elaborate on that?

frail rivet
#
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
}
leaden hazel
#

oh that sounds perfect and more clear, we are going to give it a try and see if that resolves our issue

frail rivet
#

Make sure you add some good logging for each case so you get clear details about what might be happening.

leaden hazel
#

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

frail rivet
#

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?

leaden hazel
#

seems a good approach

#

is there a known timeout for the 3d secure dialogue?

frail rivet
#

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.

leaden hazel
#

I see, you mean on stripe sdk?

frail rivet
#

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.

leaden hazel
#

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?

frail rivet
#

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.

leaden hazel
#

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

#

๐Ÿ™

frail rivet
#

Happy to help! Good luck with it!

leaden hazel
#

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

frail rivet
#

Hm, that's not what I would expect, but hopefully the adjusted handling and logging will provide more details.

leaden hazel
#

fingers crossed๐Ÿคž , thx very much for the help we will try that and get back if we find anything additional after ๐Ÿ™

#

have a great day ๐Ÿ™‚