PHP code example of kaiorocha / cambioreal

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

    

kaiorocha / cambioreal example snippets

 php
\CambioReal\Config::set([
    'appId'      => 'your-app-id',
    'appSecret'  => 'your-app-secret',
    'testMode' => true,
]);
 php
ambioReal\Config::setAppId('11250214');
\CambioReal\Config::setAppSecret('6e556ff76e55...56ff7');

$request = \CambioReal\CambioReal::request([
    'client' => [
        'name'  => 'John Test',
        'email' => '[email protected]',
    ],
    'currency'  => 'USD',
    'amount'    => 130.00,
    'order_id'  => '10000052',
    'duplicate' => false,
    'due_date'  => null,
    'products'  => [
        [
            'descricao'  => 'Laptop i7',
            'base_value' => 800.00,
            'valor'      => 1600.00,
            'qty'        => 2,
            'ref'        => 1,
        ],
        [
            'descricao'  => 'Frete',
            'base_value' => 5.00,
            'valor'      => 5.00,
            'ref'        => 'São Paulo - SP',
        ],
    ],
]);