Closed mmorrison closed 11 years ago
Could you give me more description of the failure case? I don't know if it has been reported previously and it would be helpful to know the conditions required to duplicate the failure. You say, when the user is already deleted, do you mean, using the Stripe admin interface? And then attempting to delete through the rails-stripe-membership-saas application admin interface?
Sure thing! Basically when an user is deleted there is before_destroy method that cancels the stripe subscription. Then when the stripe event 'customer. subscription.deleted' is received that event blows up because the user is already deleted. Which causes the email to not be sent.
It is the same issue bug here https://github.com/RailsApps/rails-stripe-membership-saas/issues/42
After playing around with more I decided to close this PR and try another solution. Thanks for all your work on this project!
Sorry, but could you explain? Is there still an issue? Did the pull request not handle it? Is there another way to address the issue?
Yeah sorry this is still an issue. I do not believe the pull request was the right way to handle it. I think it might be better to have a method that cancels the subscription for the user first then have the stripe event ''customer. subscription.deleted' callback actually delete the user and send out the confirmation email. I hope I was able to clarify the issue. Hopefully I will get time to play around with this solution and submit a new PR. Thanks again.
Applied fix for issue where stripe event was throwing a 500 because the user was already deleted. So this allows stripe event to handle deletion of user.