You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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 detach() is indicative of an issue in your data model. This exception is there to point out a programming error and should not be used in regular control flows.
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.
IMHO, the fact that you don't know whether a source is attached to a customer or not before calling detach() is indicative of an issue in your data model.
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).
you can have the exception subclass NotImplementedError if you want it to be backwards-compatible.
I guess. Seems a bit hacky though!
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).
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.
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: