| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Hi @slisaasquatch. Great to see another contribution! Due to the size and nature of this PR, I'm going to bring it to the team for review. I'll circle back with questions as they arise. |
Sorry, something went wrong.
|
Hi @slisaasquatch. We ran integration tests on your PR and found one test failing, pertaining to terminateSubscription(). Otherwise, it looks good! testCreateSubscriptions(com.ning.billing.recurly.TestRecurlyClient) Time elapsed: 5.321 sec <<< FAILURE!
com.ning.billing.recurly.RecurlyAPIException: RecurlyAPIError{description='The "in" parameter is missing, must be one of 'full', 'partial', 'none'', symbol='refund_invalid', details='null', httpStatusCode='400', responseMetadata='ResponseMetadata{requestId=59db5a746fd50d22-ATL, cfRay=59db5a746fd50d22-ATL, statusCode=400}'}
at com.ning.billing.recurly.RecurlyClient.callRecurlyXmlContent(RecurlyClient.java:2535)
at com.ning.billing.recurly.RecurlyClient.callRecurlySafeXmlContent(RecurlyClient.java:2469)
at com.ning.billing.recurly.RecurlyClient.doPUT(RecurlyClient.java:2426)
at com.ning.billing.recurly.RecurlyClient.doPUT(RecurlyClient.java:2400)
at com.ning.billing.recurly.RecurlyClient.terminateSubscription(RecurlyClient.java:654)
at com.ning.billing.recurly.TestRecurlyClient.testCreateSubscriptions(TestRecurlyClient.java:905)
In terminateSubscription(), the URL constructed in doPUT is something like https://[your-subdomain].recurly.com:443/v2/subscriptions/53c736ab60f3b962217d224fc88b842e/terminate?refund=full?per_page=20, which is triggering the error above. We can repair this by refactoring terminateSubscription() like so: final QueryParams qp = new QueryParams();
qp.put("refund", refund.toString());
doPUT(Subscription.SUBSCRIPTION_RESOURCE + "/" + urlEncode(subscription.getUuid()) + "/terminate",
subscription, Subscription.class, qp);
The resulting URL constructed is now https://[your-subdomain].recurly.com:443/v2/subscriptions/53e20e3cab9f3d6aeceeda498688af2c/terminate?per_page=20&refund=full. This way we can retain your improvements. There are other instances where this solution can be applied that the integration tests don't catch, e.g. postponeSubscription(). We're open to suggestions on this approach. Let us know how we can help! |
Sorry, something went wrong.
|
Yep, the issue makes sense. I just pushed the fix for terminateSubscription and postponeSubscription. |
Sorry, something went wrong.
|
@slisaasquatch Thanks for taking the time to do this and contribute it back! As you might know, we've put all our modernization efforts into our new and official Java library but we still intend to support our customers on this library for as long as possible. So, we're trying to be as conservative as possible with this library as it is heavily used in our customers' legacy systems. Having said that, I think this is a positive change and worth the risks associated. I appreciate that you've attempted to make it backwards compatible (on an API level). We've prodded this enough to have the confidence to say that that effort was successful. Still, I have some questions about the upgrade process for our other users. I practiced an upgrade locally and all seemed to go well, but do you think this will require any special instructions for people who may use a shaded version of the jar? Or possible conflicts with other dependencies? Let us know if there is anything else we can test out to get some more confidence. We're admittedly a little unsure about all the possible ways this may be getting used in the wild. |
Sorry, something went wrong.
|
I think it should be a seamless upgrade for most people, unless they use the ning AHC transitive dependency, in which case they just need to include it explicitly. I think shading will only make a difference for people that are incorrectly using the shaded dependency introduced by libraries that depend on this library. |
Sorry, something went wrong.
Good to hear! Should be smooth then.
Good callout, but that consequence should be acceptable. We don't support using this API from mobile anyway. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
As you probably know, I've created a few smaller pull requests in the past, and those were actually brought over from my fork, which is what we use today on production at SaaSquatch.
The pull request you see here represents the entirety of my fork, which is at this moment up and running on SaaSquatch servers, and has been battle tested for over a year without any issue.
While my previous smaller pull requests mainly focus on fixing obvious bugs and issues, this large pull request mainly aims to "modernize" this library to make it work well on a modern environment, as well as to make some minor improvements.
Here are some key points:
If you have any questions or suggestions, please don't hesitate to ask.
Thanks!