class ApiRecipients extends ApiBase (View source)

Class to management MangoPay API for recipients

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
object
CreateObject(string $methodKey, object $entity, object $responseClassName = null, string $entityId = null, $subEntityId = null, $idempotencyKey = null)

Create object in API

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

Get entity object from API

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
DeleteObject($methodKey, $entity, $responseClassName = null)

No description

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

Executes a POST request

from  ApiBase
CastResponseToError(object $response)

Cast response object to an error object

from  ApiBase
CastResponseToEntity(object $response, string $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
Create(Recipient $recipient, string $userId, $idempotencyKey = null)

Create new recipient

Get(string $recipientId)

Get a recipient

GetUserRecipients(string $userId, Pagination $pagination = null, $sorting = null)

Get all recipients associated with a specific user

GetPayoutMethods(string $country, string $currency)

See payout methods available to your platform by currency and country

GetSchema(string $payoutMethodType, string $recipientType, string $currency)

Get a Recipient schema

Validate(Recipient $recipient, string $userId, $idempotencyKey = null)

Validate recipient data

Deactivate(string $recipientId)

Deactivate a Recipient

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 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 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[] 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 DeleteObject($methodKey, $entity, $responseClassName = null)

No description

Parameters

$methodKey
$entity
$responseClassName

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

Executes a POST request

Parameters

$methodKey

Key with request data

$entity

Entity object

$responseClassName

Name of entity class from response

$entityId

Entity identifier

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(object $response, string $entityClassName, $asDependentObject = false)

Cast response object to entity object

Parameters

object $response

Object from API response

string $entityClassName

Name of entity class to cast

$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

Recipient Create(Recipient $recipient, string $userId, $idempotencyKey = null)

Create new recipient

Parameters

Recipient $recipient
string $userId
$idempotencyKey

Return Value

Recipient

Recipient object returned from API

Recipient Get(string $recipientId)

Get a recipient

Parameters

string $recipientId

Return Value

Recipient

Recipient object returned from API

Exceptions

Exception

Recipient[] GetUserRecipients(string $userId, Pagination $pagination = null, $sorting = null)

Get all recipients associated with a specific user

Parameters

string $userId
Pagination $pagination
$sorting

Return Value

Recipient[]

Array of Recipient

Exceptions

Exception

PayoutMethods GetPayoutMethods(string $country, string $currency)

See payout methods available to your platform by currency and country

Parameters

string $country

The destination country of the payout method.

string $currency

The currency of the payout method.

Return Value

PayoutMethods

Exceptions

Exception

RecipientSchema GetSchema(string $payoutMethodType, string $recipientType, string $currency)

Get a Recipient schema

Parameters

string $payoutMethodType

Defines the payout method (e.g., LocalBankTransfer, InternationalBankTransfer).

string $recipientType

Specifies whether the recipient is an Individual or a Business.

string $currency

3-letter ISO 4217 destination currency code (e.g. EUR, USD, GBP, AUD, CAD,HKD, SGD, MXN).

Return Value

RecipientSchema

Exceptions

Exception

Validate(Recipient $recipient, string $userId, $idempotencyKey = null)

Validate recipient data

Parameters

Recipient $recipient
string $userId
$idempotencyKey

Recipient Deactivate(string $recipientId)

Deactivate a Recipient

Parameters

string $recipientId

Return Value

Recipient

Recipient object returned from API