PHP code example of tonolucro / delivery-merchant-php

1. Go to this page and download the library: Download tonolucro/delivery-merchant-php 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/ */

    

tonolucro / delivery-merchant-php example snippets



\Tonolucro\Delivery\Merchant\Http\Auth;
use \Tonolucro\Delivery\Merchant\Http\Environment;
use \Tonolucro\Delivery\Merchant\Merchant;

try{

    /**
     * Factory dos recursos da API
     */
    $manager = new Merchant(
        new Auth(
            'XXX' //Ver https://developers.tonolucro.com/merchant/autenticacao
        ),
        new Environment\Sandbox() //new Environment\Production()
    );

    /**
     * Instância do recurso /Merchant
     */
    $resource = $manager->getMerchantResource();

    /**
     * Método: https://developers.tonolucro.com/merchant/merchant#informacoes
     */
    $data = $resource->getInfo();

    /**
     * Navegue no array de informações.
     * Documentação: https://developers.tonolucro.com/merchant/objetos#merchant
     */
    print_r($data);

}catch (Exception $ex){
    die($ex->getMessage());
}
javascript
{
    "ro/delivery-merchant-php": "^1.0"
    }
}

composer