PHP Classes

File: docs/RESPONSE.md

Recommend this page to a friend!
  Classes of Ujah Chigozie peter   PHP Payment Gateway Library   docs/RESPONSE.md   Download  
File: docs/RESPONSE.md
Role: Auxiliary data
Content type: text/markdown
Description: Auxiliary data
Class: PHP Payment Gateway Library
Process payments with multiple gateways
Author: By
Last change: Update RESPONSE.md
Date: 4 months ago
Size: 1,306 bytes
 

Contents

Class file image Download

RESPONSE

The api response handling method

Get the original response object. return the original response object or null if not available.

$result->getResponse(): mixed

Get the response headers. return array of request response headers.

$result->getHeaders(): array

Get 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(): int

Check if the response is successful from gateway.

$result->isSuccess(): bool

Check if the network request failed or server doesn't respond with status code 200

$result->isError(): bool

Get a response object body returned from gateway

$result->getBody(): object

Get the response data portion of the gateway response.

$result->getData(): ?object

Get the message from gateway response body.

$result->getMessage(): string

Get the error object from gateway response.

$result->getErrors(): ?object

Get the error message from gateway response.

$result->getError(): string

Get the error code from the response.

$result->getErrorCode(): int