class RestTool (View source)

Class to prepare HTTP request, call the request and decode the response

Constants

VERSION

Methods

array
GetRequestHeaders()

Return HTTP header to send with request

GetRequestType()

Return HTTP request method

array|string
GetRequestData()

Return HTTP request data

string
GetRequestUrl()

Return HTTP request url

__construct(MangoPayApi $root, bool $authRequired = true, bool $clientIdRequired = true)

Constructor

AddRequestHttpHeader($httpHeader)

No description

object
Request(string $urlMethod, RequestType $requestType, array $requestData = null, string $idempotencyKey = null, Pagination $pagination = null, array $additionalUrlParams = null)

Call request to MangoPay API

Details

array GetRequestHeaders()

Return HTTP header to send with request

Return Value

array

RequestType GetRequestType()

Return HTTP request method

Return Value

RequestType

array|string GetRequestData()

Return HTTP request data

Return Value

array|string

string GetRequestUrl()

Return HTTP request url

Return Value

string

__construct(MangoPayApi $root, bool $authRequired = true, bool $clientIdRequired = true)

Constructor

Parameters

MangoPayApi $root

Root/parent instance that holds the OAuthToken and Configuration instance

bool $authRequired

Variable to flag that in request the authentication data are required

bool $clientIdRequired

Variable to flag if the request path should contain the clientId or not

AddRequestHttpHeader($httpHeader)

No description

Parameters

$httpHeader

object Request(string $urlMethod, RequestType $requestType, array $requestData = null, string $idempotencyKey = null, Pagination $pagination = null, array $additionalUrlParams = null)

Call request to MangoPay API

Parameters

string $urlMethod

Type of method in REST API

RequestType $requestType

Type of request

array $requestData

Data to send in request

string $idempotencyKey
Pagination $pagination

Pagination object

array $additionalUrlParams

with additional parameters to URL. Expected keys: "sort" and "filter"

Return Value

object

Response data