#derekyau - Customer Portal

1 messages · Page 1 of 1 (latest)

tender edge
#

Good question. Thinking about how to do that best...

tender edge
#

I just realized I may have been overcomplicating your question. So are you asking basically how to tell when customer.subscription.updated happens because of the customer portal vs when the next billing period starts because the latter is when you will want to change it?

young hemlock
#

Basically what I am asking is... I know that customer.subscription.updated gives me the real time quantity of what subscription the user has

Unfortuantely this would lead to me downgrading my customers early because technically they would have paid until end of term (term being month or year whichever subscription they chose)

so they shouldn't lose access until that term comes

#

so yeah I guess what I'm thinking is...

customer.subscription.updated event -> lets me know quantity was changed

some other event ? -> lets me know when to actually action on that change?

tender edge
#

Right. I think there is an easy way to check if customer.subscription.updated is from the portal or not though it is escaping me at the moment.

#

Looking in to that. I think this can be as simple as checking whether that updated event is coming from the portal or just the monthly/yearly cycle ending

iron sentinel
#

For a Subscription update you can check to see if the latest_invoice changed to see if a new Invoice has been issued or not, or check to see if the current_period_start and/or current_period_end changed to indicate the billing cycle has changed. Based on the specific property you choose you can then ignore quantity updates for events that don't change that property.