-
Notifications
You must be signed in to change notification settings - Fork 556
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
Correct URL used for refunding application fees #351
Conversation
This uses the new endpoint instead of the deprecated one. Related to stripe/stripe-php#208.
Fixes #208. See also stripe/stripe-ruby#351.
lg! This is a breaking change, so we should do a major version bump if we're going w/ semantic versioning. (Works well since the other changes since the last release are also breaking.) |
@russelldavis Thanks! And +1 on the major bump. |
Correct URL used for refunding application fees
Fixes #208. See also stripe/stripe-ruby#351.
Follows up the patch in #351, which I now believe is wrong. The trouble is that we were mutating the application fee object, when in reality an application fee refund is actually a completely new resource (see [creating a refund][create-refund]). This patch edits the original attempt to cut a new object and updates tests accordingly. Once again, related to stripe/stripe-php#208. [create-refund]: https://stripe.com/docs/api#create_fee_refund
This seems different than how we usually do things: we don't usually provide a convenience method to do sub-object creation, instead deferring to the ability to call For example, |
Yeah, going to agree with @bkrausz here. If we want to do anything, we should just remove the |
We definitely shouldn't keep the call to the deprecated endpoint. I think removing the Regardless of whether a convenience method exists, should we update the charge (like I mention in #354) when calling |
I think it would be much clearer to remove the method, since changing how it works would be more likely to break upgrades in a subtle way. Does this mean we should do a major-version pass to remove/cleanup all of our deprecated singular endpoints (Charge#refund, Transfer#cancel, ApplicationFee#refund, etc)? |
True. On the other hand, if we kept the method around, it would actually turn this into a non-breaking change for any integrations that aren't using the return value of the method (if we do what I propose in #354; for example,
Agreed, either way we should make a major-version change consistently across all those endpoints. |
Thanks for the great discussion here! Summary: agreed that using Deprecations are annoying for users, but maybe even worse, act as a discouragement to upgrading which is something that we should try to avoid here. Of course let's make sure to be open to deprecation when necessary, but it doesn't seem worth it for something so comparatively minor (I'm still endeavoring to have #313 fixed for the next one). Also, I didn't add it, but am open to the idea of possibly marking that helper as obsolete so that we can consider removing it for the next major version bump (if anyone feels particularly strongly about that).
+1 making the rounds through these! /cc @remistr |
A little history around
This is still going to be a breaking change, and one that may be more subtle that just removing the methods. We're also going to now have two official ways for refunding a charge, canceling a transfer, etc. |
Oh, yes, Thank-you! I think someone filled me in off-thread.
Can you elaborate on why you think it would be a breaking change? |
For some methods, changing the endpoint will change the behavior, mainly around returned value. In this case, |
Oh shoot, I should have been more clear on this, but can you check out the new diff in #354? Essentially the proposal here is to use the new path, but to rebuild the current resource after the call is issued (application fee in this case) so that our API stays compatible. We'll then update our documentation to use |
My FUD has been misplaced. I missed the new diff, which does the right thing.
We still need to be careful about upgrading these methods to use the new endpoints, as it is still possible that behavior differs between the new and old endpoint. However, since I don't have a concrete example, feel free to ignore. |
+1! If/when tackling them, let's make sure to pull in people who would be aware of any subtle inconsistencies of that sort. Thanks! |
This uses the new endpoint instead of the deprecated one.
Related to stripe/stripe-php#208.
/cc @russelldavies It seems like you have a fair bit of context on this one.
Would you mind taking a look? Thanks!