Skip to content

Latest commit

 

History

History
59 lines (47 loc) · 2.3 KB

File metadata and controls

59 lines (47 loc) · 2.3 KB

Retrieve An Authorisation Code

  1. viewAuthorisationCode([ 'identifierType1' => 'identifier1' ], $authorisationCode) creates a GET request to /accounts/{identifierType}/{identifier}/authorisationcodes/{authorisationCode}

This endpoint returns a specific Authorisation Code linked to an account.

  1. Here, viewAuthorisationCode([ 'identifierType1' => 'identifier1', 'identifierType2' => 'identifier2', 'identifierType3' => 'identifier3' ], $authorisationCode) creates a GET request to /accounts/{RequestorAccountIdentifiers}/authorisationcodes/{authorisationCode}

This endpoint returns a specific Authorisation Code linked to an account.

Usage/Examples

<?php
require_once __DIR__ . './../bootstrap.php';
use mmpsdk\Common\Models\Transaction;
use mmpsdk\Common\Exceptions\MobileMoneyException;
use mmpsdk\AgentService\AgentService;

try {
    /**
     * Construct request object and set desired parameters
     */
    $request = AgentService::viewAuthorisationCode('<<AUTHORISATION-CODE>>');

    /**
     *Execute the request
     */
    $response = $request->execute();

    print_r($response);
} catch (MobileMoneyException $ex) {
    print_r($ex->getMessage());
    print_r($ex->getErrorObj());
}

Example Output

mmpsdk\Common\Models\AuthorisationCode Object
(
    [authorisationCode:mmpsdk\Common\Models\AuthorisationCode:private] => ad922511-77ae-4c17-b674-f85a96fffbf7
    [codeState:mmpsdk\Common\Models\AuthorisationCode:private] => active
    [amount:mmpsdk\Common\Models\AuthorisationCode:private] => 1000.00
    [currency:mmpsdk\Common\Models\AuthorisationCode:private] => GBP
    [redemptionChannels:mmpsdk\Common\Models\AuthorisationCode:private] =>
    [redemptionTransactionTypes:mmpsdk\Common\Models\AuthorisationCode:private] =>
    [requestingOrganisation:mmpsdk\Common\Models\AuthorisationCode:private] =>
    [creationDate:mmpsdk\Common\Models\AuthorisationCode:private] => 2021-12-14T11:04:16
    [modificationDate:mmpsdk\Common\Models\AuthorisationCode:private] => 2021-12-14T11:04:16
    [requestDate:mmpsdk\Common\Models\AuthorisationCode:private] => 2021-12-14T16:34:14
    [customData:mmpsdk\Common\Models\AuthorisationCode:private] =>
    [metadata:mmpsdk\Common\Models\AuthorisationCode:private] =>
    [hydratorStrategies:protected] =>
    [availableCount:protected] => 0
)