Method for checkout when the purchase will be embedded within the external app. All sensitive data will be collected from the external application.

As it is hosted on your side, you should also take care of the communication with the issuing bank’s ACS. The communication with issuing bank’s ACS happens through a so-called 3DS MPI (merchant plug-in). We recommend this method only for PCI-SAQ D compliant merchants, as it involves serious dedication and it might not be feasible for smaller merchants. Obtaining the PCI SAQ D compliance might be a painful process.


Include SDK loader.

This will autoload necessary library files and classes

require_once './IPC/Loader.php';

Create Config object and set API configuration params

The 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 a file path using setPrivateKeyPath and setAPIPublicKeyPath.
EncryptPublicKey is required to encrypt sensitive data(Card number, Expire date, CVC)

NOTE: EncryptPublicKey is the same as the  APIPublicKey

For more information please refer to IPCIAPurchase method documentation.

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


Create Cart object and set cart items

$cart = new \Mypos\IPC\Cart; 
$cart->add('Some Book', 1, 9.99); //name, quantity, price 
$cart->add('Some other book', 1, 4.56); 
$cart->add('Discount', 1, -2.05);

Create Card object and set card details

$card = new \Mypos\IPC\Card(); 
$card->setCardHolder('John Doe'); 

Create IAPurchase object using Config object and set required params

$purchase = new \Mypos\IPC\IAPurchase($cnf); 
$purchase->setOrderID(uniqid()); //Some unique ID 
$purchase->setNote('Some note'); //Not required 
$purchase->setAccountSettlement('11111111119');//Not required 

Process request

$result = $purchase->process(); 

if ($result->getStatus() == \Mypos\IPC\Defines::STATUS_SUCCESS) { 
    echo 'success'; 
} else { 
    //Show error.