Response
The Response is the information returned from the Request call. It will be returned in the form of a Map<String, Object>.
Below is the list of Keys or Parameters returned in the Response Map:
Key (String) | Value (Object) | Additional Detail |
---|---|---|
version | ‘1.0’ | Returns the same version sent in the Request |
action | See the list of available actions | Returns the same action sent in the Request |
timestamp | Timestamp in milliseconds (Unix). | The time at which the response was returned, can be used to troubleshoot |
validRequest | Either true or false. | If the Request satisfies the Breadwinner validations, it will be returned as true |
apiErrors | This will be a list of Errors returned as JSON | Errors which Breadwinner gets while validating the request and before making the request to Payments Processor |
responseJSON | Returns the response of the record(s) as a JSON string | This includes the records data as well as any errors from the processor |
There can be some exceptions within Breadwinner and the Payment Processor may throw some errors as part of our API actions and those errors are returned in separate layers in the form of JSON.
Errors that occur while validating the request, or while making a request to the payment processor are returned as ‘errors’; when these exceptions are there, validRequest key will be sent as false.
These errors are returned as ‘errors’ as a key of the Response map, and errors is a list of Error object.
Errors that occur within the payment processor while processing the request, or while processing the data in Breadwinner are sent as ‘errors’ in the responseJSON key of the Response map.
These errors are returned as ‘errors’ in the responseJSON, which is a key of the Response map and errors is a list of Error object.
Error object contains two String parameters
Field Name | Data Type | Description |
---|---|---|
message | String | Short message about the error. |
code | String | For some errors that could be handled programmatically, a short string indicating the error code is reported. |
detail | String | A detailed explanation of the Error occurred. Example: Breadwinner was unable to process the request as the action parameter was invalid. |
Breadwinner does validation prior to calling out to the Payment Processor.