Mandate Management
Easily create or cancel a mandate reference for Request Money transactions via the myPOS Checkout API. This lets you authorize recurring or one-off transfers with enhanced control.
What You Can Do
- Register a new mandate reference to allow future Request Money operations.
- Cancel an existing mandate when it’s no longer needed.
1. Include the SDK Loader
This will autoload necessary library files and classes.
Code Example
require_once './IPC/Loader.php';2. Create Config Object and Set API Configuration Params
IpcURL is different for sandbox and production environments.
You can use the automatic configuration package or set manually keyIndex, sid, wallet, and RSA keys (for request signatures by setting key content using setPrivateKey and setAPIPublicKey or by setting file path using setPrivateKeyPath and setAPIPublicKeyPath).
Configuration package:
Code Example
$cnf->setIpcURL('https://mypos.com/vmp/checkout-test/');
$cnf->setLang('en');
$cnf->setVersion('1.4');
$configurationPackage = 'your-generated-package-token';
$cnf->loadConfigurationPackage($configurationPackage);RSA Key pair:
Code Example
$cnf->setIpcURL('https://mypos.com/vmp/checkout-test/');
$cnf->setLang('en');
$cnf->setVersion('1.4');
$cnf->setPrivateKeyPath(dirname(__FILE__) . '/keys/store_private_key.pem');
$cnf->setAPIPublicKeyPath(dirname(__FILE__) . '/keys/api_public_key.pem');
$cnf->setKeyIndex(1);
$cnf->setSid('000000000000010');
$cnf->setWallet('61938166610');For more information, see the Mandate Management method documentation.
3. Create MandateManagement Object
Code Example
$mandateManagement = new \Mypos\IPC\MandateManagement($cnf);4. Set MandateManagement Parameters
Code Example
$mandateManagement->setMandateReferece('126ca831-93d2-4dfc-ab1f-0cce1d0abe9e');
$mandateManagement->setCustomerWalletNumber('61938166612');
$mandateManagement->setAction(\Mypos\IPC\MandateManagement::MANDATE_MANAGEMENT_ACTION_REGISTER); // Use MANDATE_MANAGEMENT_ACTION_CANCEL to cancel
$mandateManagement->setMandateText('Here comes the mandate text');
$mandateManagement->setOutputFormat(Mypos\IPC\Defines::COMMUNICATION_FORMAT_XML);5. Process Request
Code Example
$result = $mandateManagement->process();
if ($result->getStatus() == \Mypos\IPC\Defines::STATUS_SUCCESS) {
echo 'success';
// success
} else {
// Show error.
}More Info
Visit the Mandate Management method documentation for a deeper dive into API fields and possible error responses.