#jairo_api

1 messages · Page 1 of 1 (latest)

placid nimbusBOT
#

👋 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.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 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/1474005260610572319

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

faint zodiac
#

We have a flow where subscriptions are created (or existing subscriptions are updated to add a new item) on background. Until recently, this item included a 100% discount coupon for the first 3 months, and we didn’t have any issues creating subscriptions.

On January 1st of this year, we removed the coupon, and since then, almost all subscriptions created via this flow fail due to SCA, presumably because the payment is attempted immediately.

To avoid SCA in this flow, would the best strategy be to continue applying a coupon for the first months so that the first payment isn’t charged at the time of creation?

Also, is it more likely for SCA to be required when the subscription has been running for several months?

regal raptor
#

in general whether a discount is applied or not isn't the most important factor here - could you share an example subscription payment that failed due to SCA so I can take a look at your flow?

#

either the subscription ID (sub_123) or payment intent ID (pi_123) is ok

faint zodiac
#

ok, give me a second please

#

sub_1S8Jl7DyCiiQ0txV48OEbe68

regal raptor
#

thanks, taking a look

faint zodiac
#

The last invoice of this subscription was affected by this problem

#

it was a subscription update to add an item

#

the invoice is in_1T2E3nDyCiiQ0txV5IjDEycu

#

both subscription creation & modification flows are affected

#

and we are looking for a better strategy in order to avoid the SCA in this kind of background operation

#

if the coupon is not important, Why, then, did we start seeing this pattern from the moment we stopped applying it?

regal raptor
#

it primarily comes down to how you collect and save/attach customer cards - the suggestions are either:

  1. if payment is due immediately on subscription creation:
    use the client_secret of the first PaymentIntent (invoice.confirmation_secret) to collect the customer's card using Elements on the front-end
    https://docs.stripe.com/billing/subscriptions/build-subscriptions?payment-ui=elements&api-integration=paymentintents#collect-payment

  2. if no payment is due immediately on subscription creation (such as for free trials):
    use the subscription.pending_setup_intent's client-secret to collect the customer's card
    https://docs.stripe.com/billing/subscriptions/deferred-payment#use-setupintents

both of these options allow you to authenticate the card when it's added, which makes it less likely that SCA will be required in the future

#

but the most important point is that 3DS/SCA should be completed either on the first payment (when a payment is immediately due), or when the card is collected (if no payment is due)

#

if the coupon is not important, Why, then, did we start seeing this pattern from the moment we stopped applying it?

to answer this directly, this is likely to happen in your approach, because the customer's card wasn't optimised (i.e. 'set up') for SCA when it was added

this means that Stripe doesn't have the same ability to request SCA exemptions, which makes an SCA more likely if something like the subscription amount changes (i.e. due to a coupon being added/removed)