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

Edit APIException to accept string for additional field #43

Merged
merged 3 commits into from
Sep 24, 2014

Conversation

rserna2010
Copy link
Contributor

Fix #41

}
catch(Balanced.Exceptions.APIException ex)
{
Assert.IsInstanceOfType(ex.additional, typeof(string));

Choose a reason for hiding this comment

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

can you also assert the extras?

here's an example of how to generate non-blank extras

curl https://api.balancedpayments.com/cards/CC5uc1B6fJPQBSJUi0m58tal/credits \
    -u ak-test-1o9QKwUCrwstHWO5sGxICtIJdQXFTjnrV: \
    -d "amount=0"

which gives you

{
  "errors": [
    {
      "status": "Bad Request",
      "category_code": "request",
      "additional": null,
      "status_code": 400,
      "category_type": "request",
      "extras": {
        "amount": "\"0\" must be >= 1"
      },
      "request_id": "OHMa7081610435611e4ac8902b12035401b",
      "description": "Invalid field [amount] - \"0\" must be >= 1 Your request id is OHMa7081610435611e4ac8902b12035401b."
    }
  ]
}

@mjallday
Copy link

@rserna2010 this is a breaking change. it requires you to bump the version number appropriately so that customers do not upgrade to this version and break their code.

lgtm.

@remear
Copy link
Contributor

remear commented Sep 24, 2014

@rserna2010 I believe right now bumping versions requires changing it in the following locations:

https://github.com/balanced/balanced-csharp/blob/master/Balanced/Properties/AssemblyInfo.cs#L35-L36
https://github.com/balanced/balanced-csharp/blob/master/Balanced/Balanced.cs#L13

In the near future we should change https://github.com/balanced/balanced-csharp/blob/master/Balanced/Balanced.cs#L13 to read the version from the assembly so version bumping is easier. #44

Go ahead and merge this when you're ready, then bump the versions in master. I can deploy it to nuget later tomorrow. I recall the process being somewhat complicated still and not yet in the README. Just ping me when it's ready to go out.

rserna2010 added a commit that referenced this pull request Sep 24, 2014
Edit APIException to accept string for additional field
@rserna2010 rserna2010 merged commit 233887f into master Sep 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception when using test card
3 participants