#isaac_3ds-offsession

1 messages ¡ Page 1 of 1 (latest)

frozen sphinxBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!

⏱️ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1214294193585786901

📝 Have more to share? You can add more detail below, including code, screenshots, videos, etc.

hybrid axleBOT
jagged helm
#

@lean lichen if you use SetupIntent and configure usage: 'off_session' then we will try to do 3DS to minimize the need to do 3DS again in the future. Even though we do, there's no guarantee the bank won't still require 3DS so you have to adapt to that and handle the need for 3DS anyways.

Also if you're in Test mode make sure to use the "right" test cards, some of our test cards require 3DS all the time to make testing things easier: https://stripe.com/docs/testing#regulatory-cards

#

isaac_3ds-offsession

lean lichen
#

That makes sense, but if I'm testing with the "Authenticate unless set up" test card, shouldn't it succeed in this case and not require 3ds again?

jagged helm
#

it should if you set it up right. If you see otherwise please share detailed and exact information with all the relevant object(s) for me to help debug this

lean lichen
#

Okay, thank you, I will share more details in order to debug

hybrid axleBOT
lean lichen
#

Here is how I have everything set up:

  • Create a setupIntent on the server: stripe.setupIntents.create({payment_method_types: ['card']}

  • Initialize Stripe Elements in client with options:

   setupFutureUsage: 'off_session',
   mode: 'subscription',
   currency: 'usd',
   paymentMethodTypes: ['card'],
   amount: 24000,
 }}```

- Collect payment details using Payment Element (I am using the "Authenticate unless set up" test card)
- Call ```stripe.confirmSetup({
        clientSecret,
        elements,
        redirect: 'if_required',
      })```
- User confirms  3DS authentication
- Send resulting paymentMethodId to the server and attach to the customer
- Server calls
```stripe.subscriptions.create({
    customer,
    items: ....
    payment_behavior: 'error_if_incomplete',
  • subscription fails to create with error: Payment for this subscription requires additional user action before it can be completed successfully. Payment can be completed using the PaymentIntent associated withsubscription.latest_invoice.
devout harbor
lean lichen
#

That works, thank you!

#

I'm a little confused though, because shouldn't this payment be considered "on-session"? The customer is being charged for the first billing period immediately after they sign up and enter payment information. Just want to make sure that creating the subscription as "off-session" won't cause any other problems.

devout harbor
#

Yes, but for those scenarios the best way to set that up is to create the Subscription upfront and have your page confirm that subscription's first payment inent when the user enters their payment details. That will set up the payment method for future off session payments and the user will properly be presented with 3DS auth once if needed.
If you do a SetupIntent and then create a subscription, there will always be a chance that the initial charge on the subscription will also require 3DS, so the user would have to fill out 3DS twice.