PHP code example of tpay-com / tpay-openapi-php

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

    

tpay-com / tpay-openapi-php example snippets


git clone https://github.com/tpay-com/tpay-openapi-php.git

$tpayApi = new TpayApi($clientId, $clientSecret, true, 'read');
$transactions = $tpayApi->Transactions->getTransactions();

Logger::disableLogging();

Logger::setLogPath('/my/own/path/Logs/');

Logger::setLogger($logger);

Util::$customTemplateDirectory = '/my/own/templates/path/';

Util::$libraryPath = '/my/own/path/';

// Any time you construct the class providing payment forms, you can pass the language in constructor
$paymentForms = new PaymentForms('pl');
// After this line all static messages (input labels, buttons titles etc.) will be displayed in Polish

// If you want to access translations manually, use:
$lang = new Lang();
$lang->setLang('pl'); // for setting language
$lang->lang('pay'); // to echo translated key