#subalee
1 messages ยท Page 1 of 1 (latest)
What would be the best way to "reroll" the subscription back to the pre-failed SCA authentication?
There's no automatic way (hence pending updates). You'd need to handle that maually
Instead you should enable the automatic 3DS emails: https://stripe.com/docs/billing/revenue-recovery/customer-emails#secure-payments
Understood, does the subscription in past due state have previous_attributes property? That would be very helpful to getting it back to its original state
The previous_attributes is a field only included in webhooks. Not regular API responses
Also one more thing regarding this. If a subscription gets into past due state because of a failed SCA auth and because of our settings the subscription gets cancelled, is there a way to go around that?
You'd just adjust your billing settings to prevent the status transition/cancellation
Makes sense regarding the previous_attributes one last thing (hopefully, thank you so far btw ๐ )
If a user fails or rather leaves the SCA auth flow, how long till stripe resolves the payment as failed? or will it be hanging in incomplete state for 24 hours and then get incomplete_expired state or smth like that?
If a user fails or rather leaves the SCA auth flow, how long till stripe resolves the payment as failed?
It'd depend on your retry policies on the Invoice
All right I will go check those settings then.
Maybe one last thing would somehow using error_if_incomplete help here? I'm guessing the payments would always fail in case an auth step is required, right?
Well your API request to create/update the Subscription would just fail in scenarios where 3DS is/was requested
So the Subscription would remaining in original state in cases of upgrades/downgrades
Maybe you implement that flow, and then you can prompt user to come on-session to complete the upgrade
All the scenarios I'm describing are on-session (if you don't mean stripe checkout/portal by that) The user is actively trying to update their subscription but ofc this can fail for many different reasons in case 3DS comes into play.
I guess creating a new PM wouldn't work either in case its a CC which requires auth for every transaction, correct?
Well 'every transaction' isn't necessarily true (depending on how the card is setup)
3DS/auth is at the discretion of the bank, but there are exemptions we request for recurring payments. If you've a specific example I can look at
Right, but how is the payment method created
oh, so basically we create the subscription via API using the follwoing config
customer: customerId,
proration_behavior: 'always_invoice',
payment_behavior: 'default_incomplete',
off_session: true,
default_tax_rates: taxRateId ? [taxRateId] : [],
items,
add_invoice_items: oneTimeItems ?? [],
expand: ['latest_invoice.payment_intent'],
coupon: couponId,
Then we return the client secret from the payment intent to our client where we confirm it using stripe's client SDKs
Yeah but I'm interested in seeing the specific pm_xxx that is used for the payment(s)
I guess it's set on the Customer object?
yes, it's set as a default PM on the customer upon successful subscription creation
setCustomerDefaultPaymentMethod(customerId: string, paymentMethodId: string) {
return this.stripe.customers.update(customerId, {
invoice_settings: {
default_payment_method: paymentMethodId,
},
});
}
this is the implementation
This is pretty much the case I'm describing https://dashboard.stripe.com/test/customers/cus_OB1spyD8J2hJjZ
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I've used one of the stripe test cards that always requires authentication ๐
Ah, yeah I mean in most scenarios that's not realistic
Sure it can happen, but 4000002500003155 is a better option that is more aligned with real world use cases
What specific limitation of pending_if_incomplete is preventing you from using that?
there were several actually, the latest issue was regarding coupons and the other one I belive was regarding removing subscription items. I have worked around that one by first setting the quantity to 0 and then making a subsequent update to remove the item once the pending update was successfully completed... but for the coupon I'm not sure how to work around that
Do you have a specific error I can see? I believe we were working on this...
hmm give me a couple of minutes to simulate this, brb
Sure
This is the err msg
When payment_behavior is set to pending_if_incomplete, you can only pass supported params. coupon is not supported
What's the req_id?
Checking on the status of this work, bear with me
We were basically working on adding coupon support and item deletion with pending_if_incomplete
that would be super awesome!
we are on apiVersion: '2022-11-15', so maybe its outdated?
hmm seems like thats the latest one,
No, API version isn't related here
We ship new stuff all the time independent of API versions (that's just for breaking changes)
Okay, that's great to hear! So since I'm still getting the error has the support for coupon and item deletion not been released yet?
That's what I'm checking on (there may be a beta)
Okay, let me know, I'll be waiting, thanks!
Just checking in @real flower any news?
Not yet