#Oigen

1 messages ยท Page 1 of 1 (latest)

terse lagoonBOT
heady fossil
#

Hi ๐Ÿ‘‹

I am pretty sure it will go straight to either incomplete or past_due. However, you can test this out yourself to verify this flow.

You would create the Customer and sign up for the Subscription with a valid test Card but then update the card via the API to the one that fails with Insufficient funds.

https://stripe.com/docs/testing#declined-payments

mossy moat
#

Yeah, I've tried that with time clock.
But at the end of trial subscription moved to active status and created draft invoice, when I moved time on one hour after, invoice was finalized and and subscription moved to past_due.

I also was thinking that it should be moved directly to past_due, maybe it's a time clock bug?

heady fossil
#

Oh wait. no that makes sense. The invoice it cut so that you can use it to collect payment and a new Payment Method

#

So that actually makes sense

mossy moat
#

Ah, ok ok. I have a business requirement to cancel subscription if payment fails when trial ends. And I was thinking to manually cancel it via API call inside webhook handler on the backend if previous status was trialing and currenct past_due. But looks like it's impossible because previous status will be active

#

Maybe you have an idea how it can be accomplished?

heady fossil
mossy moat
#

Correct if I'm wrong, but Stripe generates an invoice with amount 0.0$ during subscription creation in trial mode

#

So it cann't be the first invoice ๐Ÿค”

heady fossil
#

Ah yes, the trial period does goof that up.

#

Wait a sec

mossy moat
#

let me check, but I was thinking it's a bit another thing. It's when customer didn't provide paymenth_method at all

#

In my case he provided payment_method, but there are no enough available funds

heady fossil
#

That is true

mossy moat
#

Just checked, in that case subscription was moved to canceled directly from trial

#

but it's a different thing ๐Ÿ™‚

heady fossil
#

Okay but does that take care of the business requirement?

mossy moat
#

Yes, I want to achieve the same behavior if a valid payment method was provided, but there was not enough money

terse lagoonBOT
mossy moat
#

hey, any updates?

#

๐Ÿฅน

willow dirge
#

Hi @mossy moat I'm taking over, give me a sec to catch up.

#

So basically you want to cancel the subscription if the payment of the first invoice is failed, am I right?

mossy moat
#

Yeah, I use this setting for unpaid subscriptions, after some retries we cancel it

#

In current case I have a business requirement to cancel the subscription if the payment fails when the trial ends. Not sure it's the first invoice, because when subscription starts in trial mode Stripe generates invoice with 0$ amount, so basically it's a second invoice

#

In that case it's not a regular cancelation with retries. I want to cancel subscription immediately, so I need to know somehow, that subscription was in trialing status and payment failed, so I can manually cancel it