#Nazar Zvarych - 3DS

1 messages · Page 1 of 1 (latest)

timber sentinelBOT
sand siren
#

Are you following any specific guide here?

#

That isn't anything wrong, banks can just always request 3DS for any new payment or authorization, even if they have approved it before

#

Scratch that guide question. Can you tell me a bit more about this payment? Is it happening while the user is on your site again or is it some automatic charge while they are away?

jolly crystal
#

currently I use stripe test-mode and test cards

#

here what I do:
when user enter card data I do the post to server and create stripe customer and create Setup Intent

#

this setup intent has a status - require_action

#

on UI part I do next:
stripe.confirmCardSetup(clientSecret,{
payment_method: orderData.paymentMethodId
})

#

and receive callback with status = 'succeeded'

#

after this I'd like to charge money and for this I create PaymentIntent.

#

but receive a status - requires_action

sand siren
#

Quick question: in production, will the payment always be immediately after the setup, or is that just something for testing?

jolly crystal
#

payment will be in 1-2mins

sand siren
jolly crystal
#

again

#

my code works good for other payments

sand siren
#

And to be clear, in this setup there will always be a chance of that payment requiring 3DS, even if the user did 3DS auth during setup seconds ago. The bank ultimately decides whether to request 3DS or not, so your integration needs to be able to handle it

#

Can you send me the ID for this specific payment? (pi_123)

jolly crystal
#

sure

#

pi_3LqHZwFuOU3uop0s1GDfkJQp

sand siren
jolly crystal
#

could you look at this - pi_3LqI3oFuOU3uop0s1PrYKFEI

#

I used this card and received the same status 4000002760003184

sand siren
#

Right, that 3184 will always require 3DS for every new payment no matter what

#

If you want to only require 3DS during setup in your tests, use the card ending in 3155

jolly crystal
#

ok, I didn't understand how should I manage such cards?

#

such this 4000002760003184

#

I created SutepIntent
then authenticated card via stripe.confirmCardSetup()
then try to charge by creating PaymentIntent

sand siren
#

That will display the 3DS modal and allow the user to complete the payment

jolly crystal
#

but now I see this modal And press Confirm/Authenticate button

#

for SetupIntent

#

@sand siren could you clarify steps what I should do for successful charge?

sand siren
#

If you did it for the payment intent secret, that modal is for authenticating the payment itself. It isn't just for setup intents

jolly crystal
#

listen: my idea just create SetupIntent for grab user card data and charge in 1min later using PaymentIntent (using paymentMethodId)

#

I authenticate user via 3d secure modal and receive succeeded status for this SetupIntent

#

if I will create PaymentIntent - it will hold money when user confirm it, correct?

#

@sand siren ?

sand siren
#

It won't hold any money until after the user has completed 3DS I believe

#

Also why is there a minute delay here? If you know how much you are charging up front and want to place a hold, you can create the payment intent first, set its mode to capture and just do the capture call a minute later

#

That would get rid of the possibility of the user needing to do two 3DS authorizations for one payment

jolly crystal
#

delay because I collect payment information data on 3-rd step of my checkout process and charge after user complete 4-th step

#

if I will use PaymentIntent instead of SetupIntent - I will hold money on 3-rd step. It's not good, because user can skip 4step and break checkout process, but money will be hold on his card

sand siren
#

What is the 4th step?

jolly crystal
#

confirm all information and press - pay

sand siren
#

Are you using the Payment Element or Card Element here to collect details?

jolly crystal
#

what do you mean?

#

stripe.createPaymentMethod("card", card)

sand siren
jolly crystal
#

looks like card payment, correct?

sand siren
#

If you are using createPaymentMethod here I think you actually don't need the SetupIntent, you can just attach the payment method that you get from that createPaymentMethod call to your Customer object, then when you create the payment intent, pass in that payment method ID

#

That looks like card element actually

jolly crystal
#

ok Pompey

#

onw more question:
how can I use PaymentIntent without hold money and charging in 1-2mins after creating?

sand siren
#

In this case, you wouldn't create the PaymentIntent until step 4. If you are using createPaymentMethod, Step 3 can just be creating and attaching the Payment Method object, Step 4 would be creating a new Payment Intent with that payment method and confirming it

#

So the payment intent will get created 1-2 minutes after you save the card and will then try to charge it immediately. If 3DS is required it will be performed then

jolly crystal
#

problem that on step 4 I don't have payment form

#

and don't know how to show 3DS modal

#

I prefer to confirm 3DS on 3-rd step somehow

#

but again, can't do this without PaymentIntent

sand siren
#

And to be clear, with your current flow, there will always be the possibility that that is necessary anyways. Any time you confirm a payment intent it might need 3DS auth like this. If your integration doesn't want to support that it will have to fail those payments

#

Also it might be worth considering rearranging the steps. For example a lot of sites have the confirm details page be the same page where a user inputs their card data

jolly crystal
#

ok Pompey, thank you wary much

#

I'll try to change a flow