Request card token no card

This call lets you store a card without incurring a charge on your customer. It basically sends a 0 value purchase, which confirms the card and sends you back a token.


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 a file path using setPrivateKeyPath and setAPIPublicKeyPath.

For more information please refer to IPCPurchase 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'); 

Create Purchase object using Config object and set required params

$purchase = new \Mypos\IPC\Purchase($cnf); 
$purchase->setUrlCancel(''); //User comes here after purchase cancelation 
$purchase->setUrlOk(''); //User comes here after purchase success 
$purchase->setUrlNotify(''); //IPC sends POST reuquest to this address with purchase status
$purchase->setOrderID(uniqid()); //Some unique ID 
$purchase->setNote('Some note'); //Not required 


Process payment

}catch(\Mypos\IPC\IPC_Exception $ex){ 
    echo $ex->getMessage(); 
    //Invalid params. To see details use "echo $ex->getMessage();"