#gpatra

1 messages · Page 1 of 1 (latest)

cosmic kindleBOT
zinc sundial
#

Hi there!

restive willow
#

Hi Soma

zinc sundial
restive willow
#

yes correct

#

If i am deleting customer from stripe dashboard with an active subscription

zinc sundial
#

I just tested and I see: customer.deleted and customer.subscription.deleted

restive willow
#

Can you confirm me which event comes first ?

zinc sundial
restive willow
#

Okey no issues! Reason for asking is when i am deleting any subscription i am handling customer.subscription.deleted event where in my db based on customer id i am doing some query. So if customer deleted event comes first i will clear that customer reference from db

zinc sundial
#

This can happen, so you'll need to handle that case in your code.

restive willow
#

It is possible , but if i am deleting a customer and i can get customer delete event i will just update according to that , if subscription deleted event comes first , i cant differentiate it is happended due to customer delete or subscription cancel

#

Is there any way i able to know customer subscription delete event fires due to delete of customer?

zinc sundial
#

Hum, not directly.

#

But if you try to retrieve the customer of the subscription, and it's deleted, then you know.

restive willow
#

i am afraid!

#

Clumsy way, Thanks for clarification

#

You can close the thread

zinc sundial
#

Or before deleting the customer, check if they have an active subscription first. And if so, start by deleting the subscription, and only later delete the customer.

#

Happy to help 🙂