1. Go to this page and download the library: Download trustpayments/sdk 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/ */
trustpayments / sdk example snippets
// Configuration
$spaceId = 405;
$userId = 512;
$secret = 'FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=';
// Setup API client
$client = new \TrustPayments\Sdk\ApiClient($userId, $secret);
// Get API service instance
$client->getTransactionService();
$client->getTransactionPaymentPageService();
$userId = 512;
$secret = 'FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=';
// Setup API client
$client = new \TrustPayments\Sdk\ApiClient($userId, $secret);
$httpClientType = \TrustPayments\Sdk\Http\HttpClientFactory::TYPE_CURL; // or \TrustPayments\Sdk\Http\HttpClientFactory::TYPE_SOCKET
$client->setHttpClientType($httpClientType);
//Setup a custom connection timeout if needed. (Default value is: 25 seconds)
$client->setConnectionTimeout(20);
putenv('TRU_HTTP_CLIENT=curl');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.