-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better exception for Source.detach() on detached sources #376
Comments
Hey @jleclanche, thanks for the contribution! Even if the exception type could be improved, I'm a bit reluctant to pull this in as it's a breaking change. IMHO, the fact that you don't know whether a source is attached to a customer or not before calling That said, I'll leave this open for now and ask for second opinions. |
@ob-stripe you can have the exception subclass NotImplementedError if you want it to be backwards-compatible.
I do know, but it's completely possible for data to go out of sync (eg. a second client, such as a dashboard user, can detach the source, webhooks might not trigger in time etc). |
I guess. Seems a bit hacky though!
Point taken. We don't have firm plans yet, but there are a few backwards-incompatible changes I'd like to ship mid term. I've added your request to the list. Tagging this as |
stripe-python/stripe/api_resources/source.py
Line 29 in 8629450
Could this get its own exception type? I want to give customers the option to remove a source from their payment methods, and right now I have to do something like this:
Catching notimpl is weird, and this isn't really the appropriate exception type I think anyway.
The text was updated successfully, but these errors were encountered: