#subalee

1 messages ยท Page 1 of 1 (latest)

brave escarpBOT
real flower
#

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

proven quail
#

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

real flower
#

The previous_attributes is a field only included in webhooks. Not regular API responses

proven quail
#

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?

real flower
#

You'd just adjust your billing settings to prevent the status transition/cancellation

proven quail
#

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?

real flower
#

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

proven quail
#

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?

real flower
#

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

proven quail
#

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?

real flower
#

Well 'every transaction' isn't necessarily true (depending on how the card is setup)

proven quail
#

we are using off_session: true,

#

if thats what you meant

real flower
#

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

real flower
proven quail
#

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

real flower
#

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?

proven quail
#

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

#

I've used one of the stripe test cards that always requires authentication ๐Ÿ™‚

real flower
#

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?

proven quail
#

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

real flower
proven quail
#

hmm give me a couple of minutes to simulate this, brb

real flower
#

Sure

proven quail
#

This is the err msg
When payment_behavior is set to pending_if_incomplete, you can only pass supported params. coupon is not supported

real flower
#

What's the req_id?

proven quail
#

req_vo1qpJQqfzGgc0

#

sorry for the delay, had to try catch it ๐Ÿ˜„

real flower
#

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

proven quail
#

that would be super awesome!

#

we are on apiVersion: '2022-11-15', so maybe its outdated?

#

hmm seems like thats the latest one,

real flower
#

No, API version isn't related here

#

We ship new stuff all the time independent of API versions (that's just for breaking changes)

proven quail
#

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?

real flower
#

That's what I'm checking on (there may be a beta)

proven quail
#

Okay, let me know, I'll be waiting, thanks!

proven quail
#

Just checking in @real flower any news?

real flower
#

Not yet

brave escarpBOT