#altair7596

1 messages ยท Page 1 of 1 (latest)

orchid cloakBOT
sour wasp
#

๐Ÿ‘‹ how may I help?

meager fractal
#

So when stripe reaches it's max tries to retry It'll set invoice status to uncollectable right?

sour wasp
#

yes

meager fractal
#

So when I use the invoice.payment_failed webhook I use this condition if (
(dataObject['billing_reason'] == 'subscription_create' ||
dataObject['billing_reason'] == 'subscription_cycle') &&
dataObject['attempt_count'] > 0
)

#

But this condition will run even on first fail attempt of subscription_cycle.

#

I'm thinking about the way That can I get invoice status: uncollectable or something ? So I rearrange my condition that It should be ( dataObject['billing_reason'] == 'subscription_cycle' && status: uncollectable) .

meager fractal
#

Can I get status: uncollectable In this exactly webhook or I have to try something else.

sour wasp
#

what are you trying to achieve?

meager fractal
#

I want to send mail to user When stripe reaches It's max tries for payment attempt.

#

Here I set retry after 5 days

sour wasp
#

you can use the customer.subscription.deleted in that case

meager fractal
#

No see that's the case, I don't want to cancel the subscription but paused it and then send an email

#

The thing here is How can I exactly know that this webhook Getting called On all retries for a payment fail

sour wasp
#

in your settings you chose Subscription Status if all retries for a payment fail, cancel the subscription

meager fractal
#

I will pause It , That's not an issue

sour wasp
#

ok

meager fractal
#

The thing here is How can I exactly know that this webhook Getting called On all retries for a payment fail

sour wasp
#

in that case you can listen to invoice.updated

#

and check the status

meager fractal
#

Will It get the status:uncollectable ?

sour wasp
meager fractal
#

And Only in the scenario status will set to uncollectable ? Not in any other case , right ?

sour wasp
#

you can mark an invoice manually as uncollectible

meager fractal
#

Okay thanks

orchid cloakBOT