#markaw-subscription-sca-retry

1 messages · Page 1 of 1 (latest)

cedar pivot
#

hello 👋

faint isle
#

Hi!

cedar pivot
#

Is this on an initial payment, or a recurring invoice payment?

#

ie, when you start the subscription or later on

faint isle
#

This is starting the subscription. With a monthly fixed amount and metered usage

cedar pivot
#

If you're not already, this is made simpler using payment_behavior=default_incomplete as introduced in our guides earlier this year

#

which allows you to confirm the initial subscription payment client side and thus handle 3DS authentication when needed, right at the start

#

It makes the logic for creating the subscription easier to implement

faint isle
#

Yes, I am using elements and client side js to open SCA dialog

#

test mode allows me to fail the SCA, then our merchant site displays that it failed, please try another card. At that point, I wonder how to proceed. To delete and add new payment method, or to create another new subscription? so that SCA applies again and I look at the paymentIntent to figure out SCA state

#

back end is handling subscription creation, but front end handling SCA after subscription created and we know state of paymentIntent/requires SCA

cedar pivot
#

GOtcha, ok

#

Give me a moment, please

#

Ok so you definitely do not need to create a new subscription

#

You can retry the payment using the existing latest_invoice.payment_intent and this is the recommended way to go

#

You would essentially do the same thing again, use that client secret with confirmCardPayment in your client app to have the customer provide new card details

#

If you already have a payment method on file, you can also use that, by providing the payment_method: 'pm_123' in confirmCardPayment instead of the card element

#

but if it has failed previously, you might wish to consider asking the customer for different details

faint isle
#

Ok. I'm actually using stripe.createPaymentMethod to create the card, then attach that to the customer, and call to confirmCard with cardID operates SCA. I believe I can tweak it from here. Thanks!

cedar pivot
#

Ok perfect! Yep, that will work, but note that you can optionally combine these steps and use the card element directly in the confirmation, too.

faint isle
#

yeah, IIRC I didnt go down the route of replacing createPaymentMethod with confirmCardPayment because backend was creating subscription last thing after card capture