#joshualaba
1 messages · Page 1 of 1 (latest)
What's the issue?
hey, just wanted to check when I have a stripe subscription plan which bills my users every month, on the billing date each month a stripe invoice object will be generated correct?
is it right to say as well, when the invoice object is created. Payment can only be attempted if the invoice is in 'OPEN' status. Payment can NEVER be attempted. when the status is 'DRAFT'?
Correct yes, as explained above
We finalise automatically after ~1 hour and attempt payment
ok so only after finalizing(open status), then stripe will attempt payment
what if payment fails
do I get a charge.failed or invoice.payment_failed event?
Yep! invoice.payment_failed. All of this is explained at the URL I shared
yeah thats what I thought as well
but im currently not processing the failed charges as desired. Although im doing exactly as what is discussed here. And shown in the link u shared..
Not sure what 'as desired' is. Specific example?
appreciate your time in helping, give me a moment to share the example
Im receiving stripe events in the webhook, specifically i check for event.type === 'invoice.payment_failed' subsequently, I also check for event.data.object.status === 'open'.
Then i check for event.data.object.attempt_count = 1 or 2. And then subsequently do something.
Following this logic, I am doing everything right to proceed to do something, when the payment attempt fails for the first time and the 2nd time right?
Well is it working as you expect? Have you tested it?