#mterrel_unexpected

1 messages ยท Page 1 of 1 (latest)

rich hawkBOT
#

๐Ÿ‘‹ 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/1304172660892241952

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

compact mica
#
harsh forumBOT
opal karma
#

Hi there ๐Ÿ‘‹ taking a closer look

compact mica
#

Thanks! Let me know if you have questions. I'm happy to provide more specifics.

opal karma
#

Thanks for the context, i think I have a good sense of what is going on. I fear this is a rough edge with the flow, where the latest_invoice is voided and so you're not able to pay it to get the Subscription back into an active state, but I'm going to double check with my teammates on that.

compact mica
#

That's what I suspected.

#

So is there a way to get the subscription back out of unpaid?

opal karma
#

Still checking with my teammates to see if they can think of a cleaner way to do it. But what is coming to mind is generating a $0 Invoice for the Subscription, to be the latest_invoice.

I'm taking a closer look though, because I see the Sub was active after the creation request:
https://dashboard.stripe.com/logs/req_Vyhm38uSXD6dAq
so I think we're misaligned on what Invoice 1 means.

compact mica
#

Yeah, I'm a little unclear what's going on there too. The subscription seems to have become active immediately, rather than waiting to charge the first invoice.

#

I don't think the first invoice got attempted until AFTER invoice 2 was voided.

#

But I'll admit I didn't study those events as closely

opal karma
#

Yup, it threw me for a loop at first since the default_payment_method is a card, but it's because it's an IN-based card which are more complex.

compact mica
#

IN-based customers seem to trigger the most bugs in our Stripe integration too. They really find where we didn't correctly test payment failure paths. :/

opal karma
#

Heh ๐Ÿ˜… they have like a 23-24 hour window during which they're sent a pre-debit notification, and if they don't accept it the payment fails asynchronously. For asynchronous payments the Subscription immediately goes into an active state, and then may change if that first payment turns out to fail.

compact mica
#

Ahhhh...I didn't see that in the docs

opal karma
#

That's understandable, it's split out in this doc:
https://docs.stripe.com/india-recurring-payments

To prevent this situation, I'd suggest adding logic to block updating Subscriptions until the first Invoice is paid successfully.

If you can replicate this in testmode, I'd suggest trying to create a $0 Invoice for the Subscription to make sure that brings it back to an active state. Or if you can handle Subscriptions in a trialing state, you can add a trial period that lasts until the next billing period.

Learn how to update an integration to support RBI e-mandates.

compact mica
#

Ugh. That sucks to have to do because of how we try to keep our own concept of subscription in sync with Stripe's status. But yes, that does sound like what we need to do just because otherwise, it's a great way to scam us and get free service without ever making a payment. (We have to deal with unsavory folks like that a lot.)

#

So is the "auto active" unique to a freshly created subscription? I'm assuming we can still rely on the standard pending update behavior where the pending update doesn't progress to "active" (applied to the subscription) until the invoice is paid, right?

opal karma
#

I'm pretty sure that's correct.

compact mica
#

Can I create the $0 invoice via the dashboard? I tried going from the subscription page specifically, then clicked Actions > Create one-time invoice. But that doesn't seem to set invoice.subscription. Do I have to do something specific to get that attachment to the subscription? Or do I have to do that via API?

opal karma
#

I'm not as familiar with how to do that from the dashboard, let me poke around a bit.

compact mica
#

Thanks!

opal karma
#

Huh, it definitely doesn't feel intuitive that creating a one-tine Invoice from the Subscription page doesn't tie the Invoice to that Subscription (at least to me), but that's what I'm seeing as well. So i think you're going to have to use the API for that.

#

Or the CLI/Shell

compact mica
#

Ok, no problem. Thanks for the confirmation.

#

I think that's all the questions I have for the moment. Thanks a lot for your help. Y'all are always a pleasure to work with.

opal karma
#

Any time! I'll keep the thread open for a bit in case anything goes wonky while you test out my suggestions, since we're pretty deep into edge-case territory here.

compact mica
#

Thanks, I appreciate that.

opal karma
#

Quick heads up that I'll be closing this thread out shortly as my teammate gets ready to take over the server. If there is anything else that comes up you are welcome to create a new thread with a brief summary of where you're at and they'll be happy to help.

compact mica
#

No worries. Thanks again for all the help!