#Matt11-error-confirm-PaymentIntent

1 messages ยท Page 1 of 1 (latest)

rancid radish
#

Hello ๐Ÿ‘‹
What error are you running into?

toxic zinc
#

Hello, this morning I created a PaymentIntent (pi_3LD2XpApMCw5clA30JaOTb1k) with "requires_actions" status

#

I waited a few hours to confirm it and then called:

intent = Stripe::PaymentIntent.retrieve(intent_id)
#

the intent was intent['status'] == 'requires_action'

#

so I called this

intent = Stripe::PaymentIntent.confirm(
          intent_id,
          {
            return_url: return_url
          }
        )
rancid radish
#

requires_action status means PaymentIntent needs to go through 3DS auth

toxic zinc
#

but later this condition returned me False:
if intent && intent['next_action'] && intent['next_action']['redirect_to_url'] && intent['next_action']['redirect_to_url']['url']

rancid radish
#

are you using Stripe.js on client-side?

toxic zinc
#

here I'm on Ruby

#

there wasn't a request on my smartphone to confirm with 3ds

#

because usually the confirmation on my smartphone happen after

intent = Stripe::PaymentIntent.confirm(
          intent_id,
          {
            return_url: return_url
          }
        )
#

but since this returned FALSE I wasn't redirected

if intent && intent['next_action'] && intent['next_action']['redirect_to_url'] && intent['next_action']['redirect_to_url']['url']
#

but the PI was successfull and charged

rancid radish
#

can you share the PaymentIntent ID? And if you're following a guide for this, can you share the URL as well? Thanks

toxic zinc
#

pi_3LD2XpApMCw5clA30JaOTb1k

#

I have no guide for this

rancid radish
#

Not sure why the second confirmation worked ๐Ÿค”
did it happen with just this one PI or were there any other examples?

toxic zinc
#

only this one

#

but if a lot of customers 'waits' hours before the 3ds they are going to pay without doing stuff in my application

rancid radish
#

the second confirmation request shouldn't have worked unless I'm missing something, let me check with my team about this

toxic zinc
#

thanks

#

because the customers actions were these:
1- entered the application
2- redirected into the 3ds page where I confirmed the payment_intend passing the redirect_url
3- intent['next_action'] was empty so no redirect was made

rancid radish
#

Okay wait I think I'm misunderstanding something her
Let's step back, is your question why there was no redirect after the payment succeeded or why the 3DS authentication worked on second confirmation call?

toxic zinc
#

I don't understand why after the confirmation of the PaymentIntent (via API) there wasn't a redirect to the redirect_url

rancid radish
#

Gotcha. Okay, let me take a look again

toxic zinc
#

and the why intent['next_action'] was empty. thanks a lot!

rancid radish
#

Okay so as far as I can tell, retrun_url was missing from the first confirmation attempt (before 3DS) and was provided with the second one (after 3DS). I wonder if that's the reason here

toxic zinc
#

I'm trying again with this one pi_3LD80QApMCw5clA30AX64z2v

#

last activity is requires_action

rancid radish
#

yeah you need to go through 3DS authentication

toxic zinc
#

yes, so I'm going to do this

return_url = subscribe_sca_success_url
        intent = Stripe::PaymentIntent.confirm(
          intent_id,
          {
            return_url: return_url
          }
        )
#

and check if this is present
intent && intent['next_action'] && intent['next_action']['redirect_to_url'] && intent['next_action']['redirect_to_url']['url']

#

I'm going to print it to console

#

now it worked

#

so I'm thinking that is beacause we waited a lot of hours

#

because it was the only difference

#

how much time do I have to confirm a payment intent?

rancid radish
#

I don't think it was the time
I think it was missing return_url in the first confirmation call

toxic zinc
#

but where you see that there were two confirmation calls?

rancid radish
#

One before requires_action and one after

toxic zinc
#

wow I don't know from when it comes from