1. Go to this page and download the library: Download webchemistry/thepay 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/ */
/** @var WebChemistry\ThePay\ThePay */
$thepay;
$sender = $thePay->createSender(199); // Price
$sender->setDescription('Super product'); // Description for easier identification in administration
$sender->setMerchantData('Customer id is 150.');
// or
$sender->setMerchantData([
'customer' => 150
]);
echo $sender->render();
/** @var WebChemistry\ThePay\ThePay */
$thepay;
$receiver = $thepay->getReceiver();
if (!$receiver->verifySignature(FALSE)) {
die('Bad request.');
}
if (!$receiver->isSuccess()) {
die('Payment was not successful.');
}
// Get info from api
$remotePayment = $receiver->getRemotePayment();
if ($remotePayment) {
$remotePayment->getValue(); // Price
}
$payment = $thepay->createPermanent('merchantData', 'description', 'localhost/returnUrl.php');
$payment->getMethods(); // Array of methods with payment information
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.