Skip to content
This repository has been archived by the owner on Oct 31, 2021. It is now read-only.

stripe: Handle a customer being deleted. #254

Open
elliotcourant opened this issue Jul 21, 2021 · 4 comments
Open

stripe: Handle a customer being deleted. #254

elliotcourant opened this issue Jul 21, 2021 · 4 comments
Assignees
Labels
Billing Stripe related issues. bug Something isn't working

Comments

@elliotcourant
Copy link
Member

If the customer is deleted in Stripe then this error is seen the next time the user tries to make an API call.

image

@elliotcourant elliotcourant added bug Something isn't working Billing Stripe related issues. labels Jul 21, 2021
@elliotcourant elliotcourant self-assigned this Jul 21, 2021
@elliotcourant
Copy link
Member Author

Added handling of the customer.deleted webhook in 9db1e73

This will just set the customer Id to nil. This way a new customer gets created the next time the customer tries to use their account.

@elliotcourant
Copy link
Member Author

image

this did not fix the problem

@elliotcourant
Copy link
Member Author

image

New Problem; stripe can sometimes deliver webhooks in the wrong order. Since we only assert whether or not a subscription is active based on the last received webhook we cant handle this properly right now.

The update subscription webhook had the active status which is correct, but we received the create subscription webhook after it. The create subscription webhook had an "incomplete" status which broke the subscription state.

@elliotcourant
Copy link
Member Author

I've fixed the problem with webhooks being delivered in the wrong order. But still need to verify the behavior when a customer is deleted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Billing Stripe related issues. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant