Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

ReportFile

Munir Wanis edited this page Oct 25, 2015 · 5 revisions

ReportFile Method

<?php

try
{
    // Load Dependencies
    require_once(dirname(__FILE__) . '\vendor\autoload.php');

    // Load configuration file with URL and Merchant Key
    require_once(dirname(__FILE__) . '\config.php');

    // Define the used URL
    \Gateway\ApiClient::setBaseUrl(Config::REPORT_FILE_URL);

    // Define the Merchant Key
    \Gateway\ApiClient::setMerchantKey(Config::MERCHANT_KEY);

    // Create new ApiClient object
    $client = new Gateway\ApiClient();

    // Make the call
    $response = $client->SearchTransactionReportFile('20150928');

    // Print the response
    print "<pre>";
    var_dump($response);
    print "</pre>";
}
catch (\Gateway\One\DataContract\Report\ApiError $error)
{
    // Print JSON
    print "<pre>";
    print ($error);
    print "</pre>";
}
catch (Exception $ex)
{
    // Print JSON
    print "<pre>";
    print ($ex);
    print "</pre>";
}

ReportFileDownloader

<?php

try
{
    // Load Dependencies
    require_once(dirname(__FILE__) . '\vendor\autoload.php');

    // Load configuration file with URL and Merchant Key
    require_once(dirname(__FILE__) . '\config.php');

    // Define the used URL
    \Gateway\ApiClient::setBaseUrl(Config::REPORT_FILE_URL);

    // Define the Merchant Key
    \Gateway\ApiClient::setMerchantKey(Config::MERCHANT_KEY);

    // Create new ApiClient object
    $client = new Gateway\ApiClient();

    // Make the call
    $response = $client->DownloadTransactionReportFile('20150928', "C:\\Temp");

    // Print the response
    print "<pre>";
    var_dump($response);
    print "</pre>";
}
catch (\Gateway\One\DataContract\Report\ApiError $error)
{
    // Print JSON
    print "<pre>";
    print ($error);
    print "</pre>";
}
catch (Exception $ex)
{
    // Print JSON
    print "<pre>";
    print ($ex);
    print "</pre>";
}

ReportFileParser

<?php

try
{
    // Load Dependencies
    require_once(dirname(__FILE__) . '\vendor\autoload.php');

    // Load configuration file with URL and Merchant Key
    require_once(dirname(__FILE__) . '\config.php');

    // Define the used URL
    \Gateway\ApiClient::setBaseUrl(Config::REPORT_FILE_URL);

    // Define the Merchant Key
    \Gateway\ApiClient::setMerchantKey(Config::MERCHANT_KEY);

    // Create new ApiClient object
    $client = new Gateway\ApiClient();

    // Make the call
    $file_to_parse = $client->SearchTransactionReportFile('20150928');

    $response = $client->ParseTransactionReportFile($file_to_parse);

    // Print the response
    print "<pre>";
    var_dump($response);
    print "</pre>";
}
catch (\Gateway\One\DataContract\Report\ApiError $error)
{
    // Print JSON
    print "<pre>";
    print ($error);
    print "</pre>";
}
catch (Exception $ex)
{
    // Print JSON
    print "<pre>";
    print ($ex);
    print "</pre>";
}