PHP code example of cyphp / empg

1. Go to this page and download the library: Download cyphp/empg 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/ */

    

cyphp / empg example snippets




use Empg\Client;

$client = new Client('MY_STORE_ID', 'MY_API_TOKEN');

$response = $client->post(
    new MpgRequest(
        new MpgTransaction([
            // ...
        ])
    )
);


$client = new Client('MY_STORE_ID', 'MY_API_TOKEN', [
    'env' => Empg\Configuration::ENV_TEST,
]);