#yonatan

1 messages · Page 1 of 1 (latest)

craggy topazBOT
formal nova
#

hello! can you share the Invoice id where the customer was charged outside of their billing cycle?

tribal wind
#

this is the customer id: cus_O2GvqIXNUxF5nk

#

sure, invoice id: in_1NGahyCWcHXwVLZTubtJe2zN

formal nova
#

gimme a second to look into this

formal nova
#

so the invoice was generated when your customer cancelled the subscription via the Customer Portal. What's odd is that you specified proration_behaviour as none when you configured the cancellation behaviour for the customer portal, so I wouldn't have expected it to prorate any existing usage.

This is going to take some time to look into, can you write in to https://support.stripe.com/contact/email with the object ids and mention what I said? We'll look further into this and get back on the ticket

tribal wind
#

I sent the details through the link you shared

formal nova
#

alright, we'll get back to you after looking into it!

tribal wind
#

is it happens again with other users, both users disabled their subscription through the billing portal
I think that what happens is that stripe cancels the subscription, and only then creates an invoice and charge the user for any outstanding payments
the problem is that in the docs it says to listen to 'invoice.paid' event to activate the subscription internally, but the problem is it is sent after the subscription is cancelled, and causes activation of a cancelled subscription

formal nova
#

sorry, i'm not sure i understand this correctly - so when a subscription is cancelled, you're listening for the invoice.paid event and doing something?

tribal wind
#

I'm always listening to this event, in docs it says this event indicates the subscription is started (when you first create a subscription), the problem is I didn't expect to receive it after a subscription is cancelled

#

maybe I'm confusing with 'checkout.session.completed'

#

shouldn't I listen to 'invoice.paid' ?

formal nova
#

an invoice.paid event would be generated whenever an invoice is paid

tribal wind
#

if someone has a filed invoice of a recurring payment, I'm getting 'invoice.payment_failed', and pausing their subscription internally
if they pay the invoice, I want to reactivate their subscription, to which webhook should I listen?

craggy topazBOT
odd crane
#

You'd listen for invoice.paid

tribal wind
#

but then it is also sent after the subscription is cancelled

odd crane
#

Sure, that can happen as invoices can still be paid even after cancellation. You'd need to void any open invoices when you delete/cancel the subscription

tribal wind
#

what? it doesn't make sense

odd crane
#

What doesn't make sense?

tribal wind
#

the invoice is created after the subscription is cancelled because there is some extra payment to be made

#

I cant delete/cancel it

#

I will loose payment that should be made

odd crane
#

Then I'm not sure what you're asking me then. You'd listen for invoice.paid events as advised

tribal wind
#

as discussed above, a user cancels their subscription, and after it an invoice is paid with all the extra charges (if any)
in that case I get invoice.paid , but the problem is the subscription is cancelled. I'm listening to invoice.paid in cases a subscription is not cancelled, and a recurring invoice is paid

#

I want to see the subscription invoices are being paid and keep the subscription active internally

#

but if I get it after the subscription is cancelled it leads to marking a subscription as active even though it is cancelled by the user

odd crane
tribal wind
#

and what should I check there?

odd crane
tribal wind
#

if a payment fails, what will be the subscription status?

odd crane
tribal wind
#

it says there "you can set the subscription status" how do I do that? through the api?

odd crane
tribal wind
#

it says in the settings that if all payment retries fail it marks the subscription as canceled, what will be the subscription status while retrying ?

odd crane
#

It'd persist the current state

tribal wind
#

ok, thank you for the help!

#

sorry another question - if all retries fail, and the subscription is marked as cancelled, will I get the customer.subscription.deleted event?

odd crane
#

Yep!