Skip to content
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: Adding workaround for incorrectly cased constants returned from the API #281

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

douglasmiller
Copy link
Contributor

@douglasmiller douglasmiller commented Oct 31, 2024

The API is returning a capitalized Account or Subscription value for a Coupon's redemption_resource value. However, the API requires that the same value be lowercase when creating a Coupon.

Until the API can be corrected, we will attempt to convert the API response to lowercase if a constant value is not found.

Testing:

import com.recurly.v3.Client;
import com.recurly.v3.resources.Coupon;

final Client client = new Client("<private api key>");
final Coupon coupon = client.getCoupon("code-" + couponCode);
System.out.println("Redemption Resource: " + coupon.getRedemptionResource());

@douglasmiller douglasmiller added bug Something isn't working V4 v2021-02-25 Client labels Oct 31, 2024
Copy link

@dacostagarcia dacostagarcia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. well done!

@andcoca
Copy link
Contributor

andcoca commented Oct 31, 2024

DevQA+1

@andcoca andcoca merged commit 53479e1 into v3-v2021-02-25 Oct 31, 2024
12 checks passed
@andcoca andcoca deleted the redemption-resource-fix branch October 31, 2024 15:45
recurly-integrations pushed a commit that referenced this pull request Oct 31, 2024
[Full Changelog](4.59.0...4.59.1)

**Merged Pull Requests**

- fix: Adding workaround for incorrectly cased constants returned from the API [#281](#281) ([douglasmiller](https://github.com/douglasmiller))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working V4 v2021-02-25 Client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants