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 message formatting #2

Open
luismendozamx opened this issue Nov 23, 2018 · 2 comments
Open

Error message formatting #2

luismendozamx opened this issue Nov 23, 2018 · 2 comments

Comments

@luismendozamx
Copy link

We had an issue with our Alegra account going over the limit of allowed transactions. The gem was translating the error received from:

{"code":900,"message":"Has llegado al limite de ventas en tu plan actual."}

to:

Status: 402. Error: Required payment!

This was a little confusing since we were calling the Alegra::Client.invoices.create which accepts the payments and paymentMethod fields. We thought the error was referring to those not being present until we debugged the gem and found the original error message.

Is there a way we could return the original message and Alegra error code in the Error? We could submit a PR with that solution if need be.

@degzcs
Copy link
Owner

degzcs commented Nov 23, 2018

Hey @luismendozamx, Please sent the PR I'll be glad to reviewed and accepted.
BTW, sorry for the delay I was kind of busy these days and thanks for reporting the issue

@luismendozamx
Copy link
Author

Awesome, thank you for the response @degzcs. We'll send a PR with the changes in a few days ;)

degzcs pushed a commit that referenced this issue Mar 17, 2020
)

* add company class with find action

* add company endpoint wrapper

* add alegra company endpoint basic tests

* add options hash to requests, refactor code a bit and return raw response if option format == raw

* add alegra record.rb and put contacts, payments and all records to inherit from it to refactor a bit

* gitignore byebug history

* pass options to put on company too

* delete byebug historu

* add wrapper with tests for users endpoints

* add categories endpoint wrapper with tests

* adds wrapper for bank accounts endpoint with tests

* details

* update readme
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

No branches or pull requests

2 participants