#jairo_api
1 messages · Page 1 of 1 (latest)
👋 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.
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?
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
thanks, taking a look
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?
it primarily comes down to how you collect and save/attach customer cards - the suggestions are either:
-
if payment is due immediately on subscription creation:
use theclient_secretof 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 -
if no payment is due immediately on subscription creation (such as for free trials):
use thesubscription.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
your current approach uses the Card Element + the Attach Paymentmethod API to tokenise and attach the card:
https://dashboard.stripe.com/acct_16HHobDyCiiQ0txV/logs/req_lA14cpUpG0XOhA
https://dashboard.stripe.com/acct_16HHobDyCiiQ0txV/logs/req_dCV6shHIl5xIVG
this doesn't support completing SCA when you collect/save the card, which makes future SCA checks more likely on the subscription
the SCA exemptions for subscriptions are described here: https://support.stripe.com/questions/strong-customer-authentication-(sca)-exemptions-for-recurring-charges-with-stripe-billing
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)