PHP code example of hypertech / paysuite-php-sdk
1. Go to this page and download the library: Download hypertech/paysuite-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/ */
hypertech / paysuite-php-sdk example snippets
use Hypertech\Paysuite\Client;
$secret = "SuaChaveSecreta";
$paysuite = new Client($secret);
$paysuite->enableTestMode(); // Chame esta função para habilitar o modo de teste
$result = $paysuite->checkout([
"tx_ref" => 'FACT123',
"currency" => "MZN",
"purpose"=> "Pagamento de factura",
"amount" => 100,
"callback_url" => "http://seusite.com/callback_url",
"redirect_url" => "http://seusite.com/invoice.php"
]);
if ($result->isSuccessfully()) {
$checkoutUrl = $result->getCheckoutUrl();
} else {
echo $result->getMessage();
}
bash
composer