#bruno-subs-3ds

1 messages · Page 1 of 1 (latest)

hallow jacinth
#

hello, reading up one sec

#

well so you have a unique scenario (limit of 1 sub per customer) so there is no tutorial for this

but really what you can do is:

Is there a way to somehow cancel subscription and PaymentIntent confirmation from step 1), before starting subscription flow 2)?

you can a/ reuse the PaymentIntent and sub from the first try, those still exist and can be reuused
or b/ you can cancel the first Subscription and create a new one

you can do this via https://stripe.com/docs/api/subscriptions/list#list_subscriptions-customer
so list all subs on that Customer and if >0 then either reuse the existing PaymentIntent to re-call confirmCardPayment() or just cancel that and create a new one

How much time (X from step 2) should be allowed to pass between starting subscription 1 and initiating another "create subscription" flow for the same customer?

timing doesn't matter here

compact lantern
#

Thank you for the quick response. The answer makes sense but this recommendation is still prone to race conditions:

b/ you can cancel the first Subscription and create a new one

Since the customer has 3DS modal open for subscription 1, they could be confirming a subscription at any moment. This could happen:

  • I check subscription 1 via API - it has "inactive" status
  • The customer confirms PaymentIntent for subscription 1, subscription is "active", charge is made
  • I cancel subscription 1 because I think it's inactive.

Does stripe have an API mechanism to somehow enforce "atomic" actions? Or something else that would help with the above scenario?
Thanks a lot!

#

Hi @hallow jacinth not sure if I'm eligible for another sub-question above, but I just want to make sure you see it. Thanks

hallow jacinth
#

oh you're fine! and yes I saw it, also in a work meeting on the side