Retrieve the Name of the Recipient
viewAccountName([ identifierType => identifier ]) creates a GET request to /accounts/{identifierType}/{identifier}/accountname
This endpoint returns the name of an account holder where one identifier suffices to uniquely identify an account.
Here, viewAccountName([ 'identifierType1' => 'identifier1', 'identifierType2' => 'identifier2', 'identifierType3' => 'identifier3' ]) creates a GET request to /accounts/{AccountIdentifiers}/accountname
This endpoint returns the name of an account holder where a single identifier is not sufficient to identify an account.
<?php
require_once __DIR__ . './../bootstrap.php ' ;
use mmpsdk \Common \Exceptions \MobileMoneyException ;
use mmpsdk \AgentService \AgentService ;
$ accountIdentifier = [
'walletId ' => 1
];
try {
/**
* Construct request object and set desired parameters
*/
$ request = AgentService::viewAccountName ($ accountIdentifier );
/**
*Execute the request
*/
$ response = $ request ->execute ();
print_r ($ response );
} catch (MobileMoneyException $ ex ) {
print_r ($ ex ->getMessage ());
print_r ($ ex ->getErrorObj ());
}
mmpsdk \Common \Models \AccountHolderName Object
(
[name:mmpsdk\Common \Models \AccountHolderName :private] => mmpsdk\Common \Models \Name Object
(
[title:mmpsdk \Common \Models \Name:private] => Mr
[firstName:mmpsdk \Common \Models \Name:private] => Jeff
[middleName:mmpsdk \Common \Models \Name:private] => James
[lastName:mmpsdk \Common \Models \Name:private] => Jimmer
[fullName:mmpsdk \Common \Models \Name:private] => Jeff Jimmer
[nativeName:mmpsdk \Common \Models \Name:private] =>
[hydratorStrategies:protected] =>
[availableCount:protected] =>
)
[lei:mmpsdk \Common \Models \AccountHolderName:private] => AAAA0012345678901299
[hydratorStrategies:protected] =>
[availableCount :protected] => 0
)