for Developers

myPOS Virtual Checkout API

These examples are created to experiment with the
myPOS Virtual Checkout API capabilities.


  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Customer object and set customer data
    $customer = new \Mypos\IPC\Customer();
    $customer->setFirstName('John');
    $customer->setLastName('Smith');
    $customer->setEmail('demo@demo.demo');
    $customer->setPhone('+359111111111');
    $customer->setCountry('BGR');
    $customer->setAddress('Business Park Varna');
    $customer->setCity('Varna');
    $customer->setZip('9000');
  • Create Cart object and set cart items
    $cart = new \Mypos\IPC\Cart;
    $cart->add('Some Book'19.99); //name, quantity, price
    $cart->add('Some other book'14.56);
    $cart->add('Discount'1, -2.05);
  • Create Purchase object using Config object and set required params
    $purchase = new \Mypos\IPC\Purchase($cnf);
    $purchase->setUrlCancel('http://mysite.com/ipc_cancel'); //User comes here after purchase cancelation
    $purchase->setUrlOk('http://mysite.com/ipc_ok'); //User comes here after purchase success
    $purchase->setUrlNotify('https://mysite.com/ipc_notify'); //IPC sends POST reuquest to this address with purchase status
    $purchase->setOrderID(uniqid()); //Some unique ID
    $purchase->setCurrency('EUR');
    $purchase->setNote('Some note'); //Not required
    $purchase->setCustomer($customer);
    $purchase->setCart($cart);

    $purchase->setCardTokenRequest(\Mypos\IPC\Purchase::CARD_TOKEN_REQUSET_PAY_AND_STORE);
    $purchase->setPaymentParametersRequired(\Mypos\IPC\Purchase::PURCHASE_TYPE_FULL);
  • Process payment
    try{
        
    $purchase->process();
    }catch(\
    Mypos\IPC\IPC_Exception $ex){
        echo 
    $ex->getMessage();
        
    //Invalid params. To see details use "echo $ex->getMessage();"
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Purchase object using Config object and set required params
    $purchase = new \Mypos\IPC\Purchase($cnf);
    $purchase->setUrlCancel('http://mysite.com/ipc_cancel'); //User comes here after purchase cancelation
    $purchase->setUrlOk('http://mysite.com/ipc_ok'); //User comes here after purchase success
    $purchase->setUrlNotify('https://mysite.com/ipc_notify'); //IPC sends POST reuquest to this address with purchase status
    $purchase->setOrderID(uniqid()); //Some unique ID
    $purchase->setCurrency('EUR');
    $purchase->setNote('Some note'); //Not required

    $purchase->setCardTokenRequest(\Mypos\IPC\Purchase::CARD_TOKEN_REQUSET_ONLY_STORE);
    $purchase->setPaymentParametersRequired(\Mypos\IPC\Purchase::PURCHASE_TYPE_SIMPLIFIED_PAYMENT_PAGE);
  • Process payment
    try{
        
    $purchase->process();
    }catch(\
    Mypos\IPC\IPC_Exception $ex){
        echo 
    $ex->getMessage();
        
    //Invalid params. To see details use "echo $ex->getMessage();"
    }
  • 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.
    EncryptPublicKey is required to encrypt sensitive data(Card number, Expire date, CVC)

    For more information please refer to myPOS Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout/');
    $cnf->setLang('en');
    $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');

    $cnf->setKeyIndex(1);
    $cnf->setSid('000000000000010');
    $cnf->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Cart object and set cart items
    $cart = new \Mypos\IPC\Cart;
    $cart->add('Some Book'19.99); //name, quantity, price
    $cart->add('Some other book'14.56);
    $cart->add('Discount'1, -2.05);
  • Create Card object and set card details
    $card = new \Mypos\IPC\Card();
    $card->setCardType(\Mypos\IPC\Card::CARD_TYPE_MASTERCARD);
    $card->setCardNumber('5555555555554444');
    $card->setExpMM('12');
    $card->setExpYY('21');
    $card->setCvc('111');
    $card->setCardHolder('John Doe');
    $card->setEci(6);
    $card->setAvv('');
    $card->setXid('');
  • Create IAPurchase object using Config object and set required params
    $purchase = new \Mypos\IPC\IAPurchase($cnf);
    $purchase->setOrderID(uniqid()); //Some unique ID
    $purchase->setCurrency('EUR');
    $purchase->setNote('Some note'); //Not required
    $purchase->setCard($card);
    $purchase->setAccountSettlement('11111111119');//Not required
    $purchase->setCart($cart);
    $purchase->setOutputFormat(Mypos\IPC\Defines::COMMUNICATION_FORMAT_JSON);
  • Process request
    $result $purchase->process();

    if (
    $result->getStatus() == \Mypos\IPC\Defines::STATUS_SUCCESS) {
        echo 
    'success';
        
    //success
    } else {
        
    //Show error.
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout/');
    $cnf->setLang('en');
    $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');

    $cnf->setKeyIndex(1);
    $cnf->setSid('000000000000010');
    $cnf->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Card object and set card details
    $card = new \Mypos\IPC\Card();
    $card->setCardType(\Mypos\IPC\Card::CARD_TYPE_MASTERCARD);
    $card->setCardNumber('5555555555554444');
    $card->setExpMM('12');
    $card->setExpYY('21');
    $card->setCvc('111');
    $card->setCardHolder('John Doe');
    $card->setEci(6);
    $card->setAvv('');
    $card->setXid('');
  • Create IAStoreCard object using Config object and set required params
    $store = new \Mypos\IPC\IAStoreCard($cnf);
    $store->setCardVerification(\Mypos\IPC\IAStoreCard::CARD_VERIFICATION_YES);
    $store->setAmount(1.00);
    $store->setCurrency('EUR');
    $store->setCard($card);
    $store->setOutputFormat(Mypos\IPC\Defines::COMMUNICATION_FORMAT_JSON);
  • Process request
    $result $store->process();

    if (
    $result->getStatus() == \Mypos\IPC\Defines::STATUS_SUCCESS) {
        
    //success
        
    echo $result->getData(CASE_LOWER)['cardtoken'];
    } else {
        
    //Show error.
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout/');
    $cnf->setLang('en');
    $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');

    $cnf->setKeyIndex(1);
    $cnf->setSid('000000000000010');
    $cnf->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Card object and set card details
    $card = new \Mypos\IPC\Card();
    $card->setCardToken('1041333312721BC752C1AB7743D0821AA1C9CA09');
    $card->setCardHolder('John Doe');
    $card->setCardType(\Mypos\IPC\Card::CARD_TYPE_MASTERCARD);
    $card->setExpMM('12');
    $card->setExpYY('21');
    $card->setCvc('111');
    $card->setEci(6);
    $card->setAvv('');
    $card->setXid('');
  • Create IAStoredCardUpdate object using Config object and set required params
    $store = new \Mypos\IPC\IAStoredCardUpdate($cnf);
    $store->setCardVerification(\Mypos\IPC\IAStoreCard::CARD_VERIFICATION_YES);
    $store->setAmount(1.00);
    $store->setCurrency('EUR');
    $store->setCard($card);
    $store->setOutputFormat(Mypos\IPC\Defines::COMMUNICATION_FORMAT_JSON);
  • Process request
    $result $store->process();

    if (
    $result->getStatus() == \Mypos\IPC\Defines::STATUS_SUCCESS) {
        
    //success
        
    echo $result->getData(CASE_LOWER)['cardtoken'];
    } else {
        
    //Show error.
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Refund object with created config
    $refund = new \Mypos\IPC\Refund($cnf);
  • Set Refund params
    $refund->setAmount(10);
    $refund->setCurrency('EUR');
    $refund->setOrderID(uniqid());
    $refund->setTrnref('123456');
    $refund->setOutputFormat(Mypos\IPC\Defines::COMMUNICATION_FORMAT_XML);
  • Send Refund request
    if($refund->process()){
        
    //Refund successful! Do something
    }else{
        
    //Do something else
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Reversal object with created config
    $reversal = new \Mypos\IPC\Reversal($cnf);
  • Set Reversal params
    $reversal->setTrnref('12345678923');
    $reversal->setOutputFormat(Mypos\IPC\Defines::COMMUNICATION_FORMAT_XML);
  • Process request
    $result $reversal->process();

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

        
    //Show error.
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create RequestMoney object with created config
    $rm = new \Mypos\IPC\RequestMoney($cnf);
  • Set RequestMoney params
    $rm->setAmount(10);
    $rm->setCurrency('EUR');
    $rm->setOrderID(uniqid());
    $rm->setMandateReferece('126ca831-93d2-4dfc-ab1f-0cce1d0abe9e');
    $rm->setCustomerWalletNumber('61938166612');
    $rm->setReason('Here comes the reason');
    $rm->setOutputFormat(Mypos\IPC\Defines::COMMUNICATION_FORMAT_XML);
  • Process request
    $result $rm->process();

    if (
    $result->getStatus() == \Mypos\IPC\Defines::STATUS_SUCCESS) {
        
    //Success. Save IPC_Trnref for transaction
        
    echo $result->getData()['IPC_Trnref'];
    } else {
        
    //Show error.
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create MandateManagement object with created config
    $mandateManagement = new \Mypos\IPC\MandateManagement($cnf);
  • Set MandateManagement params
    $mandateManagement->setMandateReferece('126ca831-93d2-4dfc-ab1f-0cce1d0abe9e');
    $mandateManagement->setCustomerWalletNumber('61938166612');
    $mandateManagement->setAction(\Mypos\IPC\MandateManagement::MANDATE_MANAGEMENT_ACTION_REGISTER);
    $mandateManagement->setMandateText('Here comes the mandate text');
    $mandateManagement->setOutputFormat(Mypos\IPC\Defines::COMMUNICATION_FORMAT_XML);
  • Process request
    $result $mandateManagement->process();

    if (
    $result->getStatus() == \Mypos\IPC\Defines::STATUS_SUCCESS) {
        echo 
    'success';
        
    //success
    } else {
        
    //Show error.
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create IPCGetTxnLog object and set required params
    $ipcLog = new \Mypos\IPC\IPCGetTxnLog($cnf);
    $ipcLog->setOrderID('1440');
    $ipcLog->setOutputFormat(\Mypos\IPC\Defines::COMMUNICATION_FORMAT_JSON);
  • Process request
    $result $ipcLog->process();
  • Check response status and use received data
    You may get response data as an array using getData() method or
    in original communication format using getDataRaw()
    switch($result->getStatus()){
        case \
    Mypos\IPC\Defines::STATUS_SUCCESS:
            
    //Display returned data in the site interfase.
            //Loop and display in table or just print_r response
            
    print_r(\Mypos\IPC\Helper::getArrayVal($result->getData(CASE_LOWER), 'log'));
            break;
        case \
    Mypos\IPC\Defines::STATUS_INVALID_PARAMS:
            
    //Order not found or set params are invalid.
            //Show error.
            
    break;
    }
  • Note:
    It is good practice to use try-catch statement to catch "IPC_Exception" exceptions
    try{
        
    $ipcLog = new \Mypos\IPC\IPCGetTxnLog($cnf);
        
    $ipcLog->setOrderID('1440');
        
    $ipcLog->setOutputFormat(\Mypos\IPC\Defines::COMMUNICATION_FORMAT_JSON);
        
    $result $ipcLog->process();
        switch(
    $result->getStatus()){
            case \
    Mypos\IPC\Defines::STATUS_SUCCESS:
                
    print_r(\Mypos\IPC\Helper::getArrayVal($result->getData(CASE_LOWER), 'log'));
                break;
            case \
    Mypos\IPC\Defines::STATUS_INVALID_PARAMS:
                echo 
    'Not found!';
                break;
        }
    }catch(\
    Mypos\IPC\IPC_Exception $ex){
        
    //Display exception message
        
    echo $ex->getMessage();
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.0');
    $cnf->setWallet('61938166610');
  • Create GetTxnStatus object and set required params
    $ipcStatus = new Mypos\IPC\GetTxnStatus($cnf);
    $ipcStatus->setOrderID('1440');
    $ipcStatus->setOutputFormat(\Mypos\IPC\Defines::COMMUNICATION_FORMAT_JSON);
  • Process request
    $result $ipcStatus->process();
  • Check response status and use received data
    You may get response data as an array using getData() method or
    in original communication format using getDataRaw()
    switch($result->getStatus()){
        case \
    Mypos\IPC\Defines::STATUS_SUCCESS:
            
    //Display returned data in the site interfase.
            //Loop and display in table or just print_r response
            
    print_r(\Mypos\IPC\Helper::getArrayVal($result->getData(CASE_LOWER), 'orderstatus'));
            break;
        case \
    Mypos\IPC\Defines::STATUS_INVALID_PARAMS:
            
    //Order not found or set params are invalid.
            //Show error.
            
    break;
    }
  • Note:
    It is good practice to use try-catch statement to catch "IPC_Exception" exceptions
    try{
        
    $ipcStatus = new \Mypos\IPC\GetTxnStatus($cnf);
        
    $ipcStatus->setOrderID('1440');
        
    $ipcStatus->setOutputFormat(\Mypos\IPC\Defines::COMMUNICATION_FORMAT_JSON);
        
    $result $ipcStatus->process();

        switch(
    $result->getStatus()){
            case \
    Mypos\IPC\Defines::STATUS_SUCCESS:
                
    print_r(\Mypos\IPC\Helper::getArrayVal($result->getData(CASE_LOWER), 'orderstatus'));
                break;
            case \
    Mypos\IPC\Defines::STATUS_INVALID_PARAMS:
                echo 
    'Not found!';
                break;
        }
    }catch(\
    Mypos\IPC_Exception $ex){
        
    //Display exception message
        
    echo $ex->getMessage();
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Response object with income POST data
    This will validate income data and request signature.
    try{
        
    $responce Mypos\IPC\Response::getInstance($cnf$_POST, \Mypos\IPC\Defines::COMMUNICATION_FORMAT_POST);
    }catch(\
    Mypos\IPC\IPC_Exception $e){
        echo 
    'Error';
    }
  • Get posted data as an array
    $data is one-dimensional array containing elements with keys: IPCmethod, SID, Amount, Currency, OrderID, IPC_Trnref, RequestSTAN,RequestDateTime

    getData() has optional argument $case to change array keys case. It must be CASE_LOWER or CASE_UPPER.

    Merchant site must have next logics:

    1. Search in DB for order with this OrderID

    2. Verify that Amount and Currency match to amount from the original transaction

    3. Change order status to "paid"

    4. echo "OK"
    $data $responce->getData(CASE_LOWER);
    if(
    '...check and update order'){
        echo 
    'OK';
    }else{
        echo 
    'Error';
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Response object with income POST data
    This will validate income data and request signature.
    try{
        
    $responce Mypos\IPC\Response::getInstance($cnf$_POST, \Mypos\IPC\Defines::COMMUNICATION_FORMAT_POST);
    }catch(\
    Mypos\IPC\IPC_Exception $e){
        
    //Display Some general error or redirect to merchant store home page
    }
  • Get posted data as an array
    $data is one-dimensional array containing elements with keys: IPCmethod, SID, Amount, Currency, OrderID, IPC_Trnref, RequestSTAN,RequestDateTime

    getData() has optional argument $case to change array keys case. It must be CASE_LOWER or CASE_UPPER.

    Merchant site must have next logics:

    1. Search in DB for order with this OrderID

    2. Verify that Amount and Currency match to amount from the original transaction

    3. Show "Thank you" page to merchant customer
    $data $responce->getData(CASE_LOWER);
    if(
    '...order is found in merchant store DB'){
        
    //Display "Your order has been successfully paid" for example.
    }else{
        
    //Display Some general error or redirect to merchant store home page
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Response object with income POST data
    This will validate income data and request signature.
    try{
        
    $responce Mypos\IPC\Response::getInstance($cnf$_POST, \Mypos\IPC\Defines::COMMUNICATION_FORMAT_POST);
    }catch(\
    Mypos\IPC\IPC_Exception $e){
        
    //Display Some general error or redirect to merchant store home page
    }
  • Get posted data as an array
    $data is one-dimensional array containing elements with keys: IPCmethod, SID, Amount, Currency, OrderID, IPC_Trnref, RequestSTAN,RequestDateTime

    getData() has optional argument $case to change array keys case. It must be CASE_LOWER or CASE_UPPER.

    Merchant site must have next logics:

    1. Search in DB for order with this OrderID

    2. Verify that Amount and Currency match to amount from the original transaction

    3. Show "Thank you" page to merchant customer
    $data $responce->getData(CASE_LOWER);
    if(
    '...order is found in merchant store DB'){
        
    //Display "Your order has been canceled" for example.
    }else{
        
    //Display Some general error or redirect to merchant store home page
    }
  • 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 Virtual API Documentation
    $cnf = new \Mypos\IPC\Config();
    $cnf->setIpcURL('https://mypos.eu/vmp/checkout-test/');
    $cnf->setLang('en');
    $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->setVersion('1.3');
    $cnf->setWallet('61938166610');
  • Create Response object with income POST data
    This will validate income data and request signature.
    try{
        
    $responce Mypos\IPC\Response::getInstance($cnf$_POST, \Mypos\IPC\Defines::COMMUNICATION_FORMAT_POST);
    }catch(\
    Mypos\IPC\IPC_Exception $e){
        echo 
    'Error';
    }
  • Get posted data as an array
    $data is one-dimensional array containing elements with keys: IPCmethod, SID, Amount, Currency, OrderID

    getData() has optional argument $case to change array keys case. It must be CASE_LOWER or CASE_UPPER.

    Merchant site must have next logics:

    1. Search in DB for order with this OrderID

    2. Verify that Amount and Currency match to amount from the original transaction

    3. Change order status to "Cancelled"

    4. echo "OK"
    $data $responce->getData(CASE_LOWER);
    if(
    '...check and update order'){
        echo 
    'OK';
    }else{
        echo 
    'Error';
    }