PHP code example of mbentertainment / trustpay-php-sdk
1. Go to this page and download the library: Download mbentertainment/trustpay-php-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/ */
mbentertainment / trustpay-php-sdk example snippets
$configuration = new \TrustPay\Configuration();
$configuration->setSuccessUrl("https://example.com/success");
$configuration->setErrorUrl("https://example.com/error");
$configuration->setCancelUrl("https://example.com/cancel");
$configuration->setNotificationUrl("https://example.com/notification");
$configuration->setAccountId("987654321");
$configuration->setSecret("abcd1234");
$configuration->setCurrency(\TrustPay\Enums\Currency::_EUR_);
$configuration->setLanguage(\TrustPay\Enums\Language::SK);
$trustPay = new \TrustPay\TrustPay($configuration);
$request = $trustPay->payment(
0.01,
"reference/Variable Symbol",
"[email protected]",
"Payment description (Order ID 1234) etc... "
);
echo $request->getUrl(); // redirect to this url