class ApiSimulation extends ApiBase (View source)

API for Sandbox simulation endpoints.

Properties

protected MangoPayApi $_root

Root/parent instance that holds the OAuthToken and Configuration instance

from  ApiBase

Methods

mixed
getLogger()

No description

from  ApiBase
__construct(MangoPayApi $root)

Constructor Root/parent instance that holds the OAuthToken and Configuration instance

from  ApiBase
string
GetRequestUrl(string $key)

Get URL for REST Mango Pay API

from  ApiBase
GetRequestType(string $key)

Get request type for REST Mango Pay API

from  ApiBase
GetApiVersion($key)

No description

from  ApiBase
object
CreateObject(string $methodKey, object $entity, object $responseClassName = null, string $entityId = null, $subEntityId = null, $idempotencyKey = null)

Create object in API

from  ApiBase
object
CreateOrUpdateMultipartObject(string $methodKey, string $file, string $fileName, string $responseClassName = null, string $entityId = null, string $idempotencyKey = null)

No description

from  ApiBase
object
GetObject(string $methodKey, object $responseClassName, $firstEntityId = null, $secondEntityId = null, $thirdEntityId = null, $clientIdRequired = true)

Get entity object from API

from  ApiBase
object
GetObjectManyQueryParams(string $methodKey, object $responseClassName, ...$queryParams)

Get entity object from API endpoint that has a lot of query params

from  ApiBase
object
GetObjectWithPagination(string $methodKey, object $responseClassName, $pagination = null, $filter = null, $entityId = null, $clientIdRequired = true)

Get entity object from API on a request path that contains pagination and other query params

from  ApiBase
object[]
GetList(string $methodKey, Pagination $pagination, object $responseClassName = null, string $entityId = null, object $filter = null, Sorting $sorting = null, $secondEntityId = null, $clientIdRequired = true)

Get lst with entities object from API

from  ApiBase
object
SaveObject(string $methodKey, object $entity, object $responseClassName = null, $secondEntityId = null, $thirdEntityId = null)

Save object in API

from  ApiBase
UpdateObject($methodKey, $entity, $responseClassName = null, $firstEntityId = null, $secondEntityId = null, $thirdEntityId = null)

Does the same thing as SaveObject above, but keeps natural order of provided entity ids when building the URL

from  ApiBase
DeleteObject($methodKey, $entity, $responseClassName = null)

No description

from  ApiBase
object
ExecutePostRequest(mixed $methodKey, mixed $entity, mixed $responseClassName, mixed $entityId = null, $idempotency_key = null)

Executes a POST request

from  ApiBase
CastResponseToError(object $response)

Cast response object to an error object

from  ApiBase
CastResponseToEntity($response, $entityClassName, $asDependentObject = false)

Cast response object to entity object

from  ApiBase
array
BuildRequestData(object $entity)

Get array with request data

from  ApiBase
GetObjectForIdempotencyUrl($url)

No description

from  ApiBase
void
SimulateBankWirePayIn(string $payInId, BankWirePayInSimulation $simulation)

Simulates the acceptance or rejection of an existing pre-declared bank wire pay-in (PaymentType BANK_WIRE, ExecutionType DIRECT). Sandbox only.

void
SimulateBankWireFunding(BankWireFundingSimulation $simulation)

Simulates an incoming bank wire funding notification to a Virtual Account, such as Mangopay would receive on its accounts in a Production scenario. Sandbox only.

Details

protected mixed getLogger()

No description

Return Value

mixed

__construct(MangoPayApi $root)

Constructor Root/parent instance that holds the OAuthToken and Configuration instance

Parameters

MangoPayApi $root

protected string GetRequestUrl(string $key)

Get URL for REST Mango Pay API

Parameters

string $key

Key with data

Return Value

string

protected RequestType GetRequestType(string $key)

Get request type for REST Mango Pay API

Parameters

string $key

Key with data

Return Value

RequestType

protected GetApiVersion($key)

No description

Parameters

$key

protected object CreateObject(string $methodKey, object $entity, object $responseClassName = null, string $entityId = null, $subEntityId = null, $idempotencyKey = null)

Create object in API

Parameters

string $methodKey

Key with request data

object $entity

Entity object

object $responseClassName

Name of entity class from response

string $entityId

Entity identifier

$subEntityId
$idempotencyKey

Return Value

object

Response data

protected object CreateOrUpdateMultipartObject(string $methodKey, string $file, string $fileName, string $responseClassName = null, string $entityId = null, string $idempotencyKey = null)

No description

Parameters

string $methodKey

Key with request data

string $file

The file content (raw binary string)

string $fileName

The file name

string $responseClassName

Name of entity class from response

string $entityId

Optional entity identifier

string $idempotencyKey

Optional idempotency key

Return Value

object

Response data

Exceptions

Exception

protected object GetObject(string $methodKey, object $responseClassName, $firstEntityId = null, $secondEntityId = null, $thirdEntityId = null, $clientIdRequired = true)

Get entity object from API

Parameters

string $methodKey

Key with request data

object $responseClassName

Name of entity class from response

$firstEntityId
$secondEntityId
$thirdEntityId
$clientIdRequired

Return Value

object

Response data

Exceptions

Exception

protected object GetObjectManyQueryParams(string $methodKey, object $responseClassName, ...$queryParams)

Get entity object from API endpoint that has a lot of query params

Parameters

string $methodKey

Key with request data

object $responseClassName

Name of entity class from response

...$queryParams

Return Value

object

Response data

Exceptions

Exception

protected object GetObjectWithPagination(string $methodKey, object $responseClassName, $pagination = null, $filter = null, $entityId = null, $clientIdRequired = true)

Get entity object from API on a request path that contains pagination and other query params

Parameters

string $methodKey

Key with request data

object $responseClassName

Name of entity class from response

$pagination
$filter
$entityId
$clientIdRequired

Return Value

object

Response data

Exceptions

Exception

protected object[] GetList(string $methodKey, Pagination $pagination, object $responseClassName = null, string $entityId = null, object $filter = null, Sorting $sorting = null, $secondEntityId = null, $clientIdRequired = true)

Get lst with entities object from API

Parameters

string $methodKey

Key with request data

Pagination $pagination

Pagination object

object $responseClassName

Name of entity class from response

string $entityId

Entity identifier

object $filter

Object to filter data

Sorting $sorting

Object to sorting data

$secondEntityId
$clientIdRequired

Return Value

object[]

Response data

protected object SaveObject(string $methodKey, object $entity, object $responseClassName = null, $secondEntityId = null, $thirdEntityId = null)

Save object in API

Parameters

string $methodKey

Key with request data

object $entity

Entity object to save

object $responseClassName

Name of entity class from response

$secondEntityId
$thirdEntityId

Return Value

object

Response data

protected UpdateObject($methodKey, $entity, $responseClassName = null, $firstEntityId = null, $secondEntityId = null, $thirdEntityId = null)

Does the same thing as SaveObject above, but keeps natural order of provided entity ids when building the URL

Parameters

$methodKey
$entity
$responseClassName
$firstEntityId
$secondEntityId
$thirdEntityId

protected DeleteObject($methodKey, $entity, $responseClassName = null)

No description

Parameters

$methodKey
$entity
$responseClassName

protected object ExecutePostRequest(mixed $methodKey, mixed $entity, mixed $responseClassName, mixed $entityId = null, $idempotency_key = null)

Executes a POST request

Parameters

mixed $methodKey

Key with request data

mixed $entity

Entity object

mixed $responseClassName

Name of entity class from response

mixed $entityId

Entity identifier

$idempotency_key

Return Value

object

Response data

protected Error CastResponseToError(object $response)

Cast response object to an error object

Parameters

object $response

Object from API response

Return Value

Error

The error

protected CastResponseToEntity($response, $entityClassName, $asDependentObject = false)

Cast response object to entity object

Parameters

$response
$entityClassName
$asDependentObject

protected array BuildRequestData(object $entity)

Get array with request data

Parameters

object $entity

Entity object to send as request data

Return Value

array

protected GetObjectForIdempotencyUrl($url)

No description

Parameters

$url

void SimulateBankWirePayIn(string $payInId, BankWirePayInSimulation $simulation)

Simulates the acceptance or rejection of an existing pre-declared bank wire pay-in (PaymentType BANK_WIRE, ExecutionType DIRECT). Sandbox only.

The pay-in must exist, have the Status CREATED and an Id beginning with the prefix payin_wf_.

  • ACCEPT: the pay-in Status becomes SUCCEEDED and the wallet is credited.
  • REJECT: the pay-in Status becomes FAILED with the ResultCode 008500.

Parameters

string $payInId

The identifier of the pay-in

BankWirePayInSimulation $simulation

The simulation request containing the Action to perform

Return Value

void

Exceptions

ResponseException

void SimulateBankWireFunding(BankWireFundingSimulation $simulation)

Simulates an incoming bank wire funding notification to a Virtual Account, such as Mangopay would receive on its accounts in a Production scenario. Sandbox only.

Parameters

BankWireFundingSimulation $simulation

The simulated incoming funds, the targeted Virtual Account (Creditor) and the simulated debtor/remittance information

Return Value

void

Exceptions

ResponseException