Make a refund for previously executed payment

Include SDK loader
This will autoload necessary library files and classes

require_once './IPC/Loader.php';

Create Config object and set API configuration params

Note that IpcURL is different for sandbox and production environment

You can set RSA keys for request signatures by setting key content using setPrivateKey and setAPIPublicKey or by setting file path using setPrivateKeyPath and setAPIPublicKeyPath

For more information please refer to myPOS Checkout API Documentation

$cnf = new \Mypos\IPC\Config(); 
$cnf->setPrivateKeyPath(dirname(__FILE__) . '/keys/store_private_key.pem'); 
$cnf->setAPIPublicKeyPath(dirname(__FILE__) . '/keys/api_public_key.pem'); 

Create Refund object with created config

$refund = new \Mypos\IPC\Refund($cnf);

Set Refund params


Send Refund request

    //Refund successful! Do something 
    //Do something else