-
Notifications
You must be signed in to change notification settings - Fork 548
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
Fix return value of Customer#delete_discount
#964
Conversation
No objection here. |
`Customer#delete_discount` has been broken for some time in that it tries to re-initialize `self` (which is a customer) with a received discount response. This is incorrect and leads to various problems. Here, we redefine the return value of `delete_discount` as a discount, and have it no longer mutate the object on which is was called. We add a comment as well just to help flag some of the behavior which could potentially be confusing. Fixes #963.
e1fc70b
to
b2c3b92
Compare
This looks good. Since this is special/non-standard I wouldn't say no to adding a test |
Flagging my concern publicly for traceability: Before 5.X calling |
@richardm-stripe I looked into this, and I don't think we can do too much better than the existing test (now change for discount) unfortunately. stripe-mock just doesn't return that much useful data to assert on other than the object type:
|
@remi-stripe Fair enough. Just to confirm: are you okay with the change as long as I update the V5 migration guide as I bring it in? |
Yes I am okay with the change and it will mirror what we do in |
Ah, great! Okay, going to pull this in then. I've updated the V5 migration guide. |
Customer#delete_discount
has been broken for some time in that ittries to re-initialize
self
(which is a customer) with a receiveddiscount response. This is incorrect and leads to various problems.
Here, we redefine the return value of
delete_discount
as a discount,and have it no longer mutate the object on which is was called. We add a
comment as well just to help flag some of the behavior which could
potentially be confusing.
Fixes #963.
r? @richardm-stripe
@richardm-stripe @remi-stripe I know there are some concerns around
backwards compatibility here, but given that anyone current trying to
use the return value of this method is pretty broken, and has been for a
while, I was thinking about just releasing it as a patch version. Any
objections?