The api response handling method
Get the original response object. return the original response object or null if not available.
$result->getResponse(): mixedGet the response headers. return array of request response headers.
$result->getHeaders(): arrayGet a specific header by key. return mixed value of header or null if not found.
$result->getHeader(string $key): mixed;Get the HTTP status code. return int, the request response HTTP status code or 0 if not failed.
$result->getStatus(): intCheck if the response is successful from gateway.
$result->isSuccess(): boolCheck if the network request failed or server doesn't respond with status code 200
$result->isError(): boolGet a response object body returned from gateway
$result->getBody(): objectGet the response data portion of the gateway response.
$result->getData(): ?objectGet the message from gateway response body.
$result->getMessage(): stringGet the error object from gateway response.
$result->getErrors(): ?objectGet the error message from gateway response.
$result->getError(): stringGet the error code from the response.
$result->getErrorCode(): int