PHP code example of parceladousa / gateway

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

    

parceladousa / gateway example snippets




    use Parceladousa\ParceladoUSA;

    Key',
        'merchantCode',
        ParceladoUSA::SANDBOX,
        "https://urlcallback"
    );



    //Transaction creation
    $data = new stdClass();
    $data->amount = 99.99;
    $data->invoice = 'Invoice Text';
    $data->currency = ParceladoUSA::AMERICANCURRENCY;
    $data->name = 'Customer Name';
    $data->email = '[email protected]';
    $data->phone = '(99)99999-9999';
    $data->doc = '99999999999';
    $data->cep = '99999999';
    $data->address = 'Street';
    $data->addressNumber = '1';
    $data->city = 'City';
    $data->state = 'ST';
    $gateway->requestPaymentOrder($data);
    var_dump($gateway->getResult());



    //Transaction query
    $gateway->consultPaymentOrder('orderId');
    var_dump($gateway->getResult());




    //Values  query
    $data = new stdClass();
    $data->amount = 56.89;
    $gateway->calculateValues($data);
    var_dump($gateway->getResult());