PHP code example of lelyfoto / mypos-cashregisterremote

1. Go to this page and download the library: Download lelyfoto/mypos-cashregisterremote library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lelyfoto / mypos-cashregisterremote example snippets


$config = new Config(
    '[email protected]',
    1, // Should be 1, unless you have more than one public key send to MyPos,
    'EUR',
    '12345678', // Your teminal ID, see your dashboard,
    file_get_contents('your_private_key.pem'),
    file_get_contents('mypos_public.crt'),
    Config::MYPOS_WSDL_PRODUCTION
);

$terminal = new Terminal($config);
$securityCode = $terminal->requestPairCodeForSubscribe();

$requestId = $terminal->makePurchase(42, 'reference id', MPRPurchase::TYPE_REFERENCE_NUMBER);