Skip to content

Comments

Add more detail to API exception messages#7

Open
amphibian wants to merge 3 commits intobambora-na:masterfrom
amphibian:master
Open

Add more detail to API exception messages#7
amphibian wants to merge 3 commits intobambora-na:masterfrom
amphibian:master

Conversation

@amphibian
Copy link

it was frustrating at times dealing with errors to do with missing or incorrect data, as only the message "title" was being returned via the API Exception class. The REST response includes a details array, so I've merged that into the returned message here.

The formatting is a little arbitrary of course, but it's the best way I could think of to append an unknown number of errors to the message string.

So instead of, e.g.,
"Missing or invalid payment information - Please validate all required payment information."

We return:
"Missing or invalid payment information - Please validate all required payment information. (State/province does not match country; Shipping state/province does not match country.)"
@RyanEwen
Copy link

RyanEwen commented Oct 2, 2020

Someone at Bambora please review this. Our company started to use this SDK and when we get error 314 we're unable to relay any details as to why the card couldn't be charged.

k-nights pushed a commit to k-nights/beanstream-php that referenced this pull request Jun 22, 2025
…'Add more detail to API exception messages'
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.

2 participants