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

Error parsing error response from CreateSubscriptionChangeAsync #737

Open
glennsdavis opened this issue Oct 18, 2022 · 1 comment
Open
Labels

Comments

@glennsdavis
Copy link

Describe the bug

Call CreateSubscriptionChangeAsync with a discount code for a free trial.

Recurly service responses with status 422 - Unprocessable Entity
{
"error": {
"type": "validation",
"message": "Coupon code ["Subscription uuid Free trials only redeemable on new subscriptions"]",
"params": [
{
"param": "coupon_code",
"message": [ "Subscription uuid Free trials only redeemable on new subscriptions" ]
}
]
}
}

SDK throws the following exception parsing the JSON response:

Unexpected character encountered while parsing value: [. Path 'error.params[0].message', line 1, position 171.

Recurly.dll!Recurly.JsonSerializer.Deserialize(RestSharp.IRestResponse response) Line 43
Recurly.dll!Recurly.BaseClient.HandleResponse(RestSharp.IRestResponse resp) Line 231
Recurly.dll!Recurly.BaseClient.MakeRequestAsync.AnonymousMethod__0(System.Threading.Tasks.Task<RestSharp.IRestResponse> t) Line 75

To Reproduce

Expected behavior

SDK is able to parse error response from Recurly service and return response from service to client of SDK.

Your Environment

  • Which version of this library are you using?

Recurly 4.21.4

  • Which version of the language are you using?

C# .NET 6.0

@nls-gharris
Copy link

Can confirm this is a bug that is impacting our implementation of the dotnet SDK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants