#thedietingdev

1 messages · Page 1 of 1 (latest)

gaunt kelpBOT
frozen sigil
#

It may be worth noting that the customer is not present for the 2nd additional payment

karmic obsidian
#

Can you share the request id req_xxx?

frozen sigil
#

Do you mean this? pi_3Nfdq2F0ydlQC8ek041oqnZj

karmic obsidian
#

I mean the 2nd payment intent which you got Your card was declined error

frozen sigil
#

That's the one there

karmic obsidian
#

No that's succeeded with a status of requires_action

#

To clarify, the first SetupIntent should already done 3DS for you. And then from next time you should just create PaymentIntent with off_session=true and most of the time the issuer bank will accept it

frozen sigil
#

Yeah, it's requesting 3DS when attempting

#

for the 2nd attempt

karmic obsidian
frozen sigil
#

So sorry, pi_3NfdpAF0ydlQC8ek08pVdRXw

#

is the right one

karmic obsidian
#

Okie, I see you are passing in pm_1NdJDZF0ydlQC8ekvx73wmOI and that doesn't seem to come from a SetupIntent

#

How did you create it?

frozen sigil
#
                        'payment_method_types' => ['card'],
                        'mode' => 'setup',
                        'currency' => 'AUD',
                        'customer' => $customer_id,
                        'success_url' => $stripe_info->getResponseSuccessUrl() . '?stripe_session_id={CHECKOUT_SESSION_ID}',
                        'cancel_url' => $stripe_info->getResponseFailUrl(),
                    ]);```
#

then redirect the user to the URL

karmic obsidian
#

You sure? What is the Checkout Session Id ? cs_test_xxx

gaunt kelpBOT
frozen sigil
#

req_4gXAcrhFSP7P8B

brisk yew
#

Taking over here. To clarify the confusion is why auth is being requested on future off-session payments with a previously setup payment method, yes?

frozen sigil
#

That's correct

brisk yew
#

To be clear, that can happen. We do optimise off-session payments to try and prevent that, but ultimately banks can (and do) request 3DS for ad-hoc payments even if the card was 'setup'

#

Is it this payment, pi_3NfdpAF0ydlQC8ek08pVdRXw?

frozen sigil
#

That's right yeah

brisk yew
frozen sigil
#

Mmm, so how do i create via a setupIntent, as we're creating a session and redirecting to stripe hosted card input page and then retrieving the setupIntent it creates

#
                        'payment_method_types' => ['card'],
                        'mode' => 'setup',
                        'currency' => 'AUD',
                        'customer' => $customer_id,
                        'success_url' => $stripe_info->getResponseSuccessUrl() . '?stripe_session_id={CHECKOUT_SESSION_ID}',
                        'cancel_url' => $stripe_info->getResponseFailUrl(),
                    ]);```
#

mode is set to setup

#

We're then storing the card token and using that as the payment method in any paymentIntents

brisk yew
#

Wait, you're using 4000000000003220?

#

That test card always requires 3DS for every payment

#

So this behaviour is expected. Instead you should use 4000002500003155:

This card requires authentication for off-session payments unless you set it up for future payments. After you set it up, off-session payments no longer require authentication.

frozen sigil
#

Ok got ya!

#

Thanks you

brisk yew
#

np

frozen sigil
#

The one thing that confused me

#

was the set up for off_session payments

#

i thought i'd done this

brisk yew
#

You have. But using 3220, and that card will always need 3DS even if you set it up

frozen sigil
#

Perfect thanks

#

I've just tried with a different card and it seems to be working and just needs capture now