PHP code example of jmadsm / gateway-client

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

    

jmadsm / gateway-client example snippets



use JmaDsm\GatewayClient\Client;
use JmaDsm\GatewayClient\ApiObjects\Product;
use JmaDsm\GatewayClient\ApiObjects\Category;

// Create singleton instance of the client
Client::getInstance( // get the config from JMA
     $config['base_url'],
     $config['access_token'],
     $config['tenant_token']
 );

$product    = Product::get('product_id');
$categories = Category::all();

while ($category = $categories->next()) { // The categories object will recursively fetch all categories in chuncks.
    echo $category->name;
}

php vendor/bin/phpunit Tests/ClientTest.php