1. Go to this page and download the library: Download rainwaves/paygate-payment 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/ */
rainwaves / paygate-payment example snippets
composer
// Create an instance of PayWebClient with your PayGate credentials
$client = new PayWeb('10011072130', 'secret');
$transactionDate = Carbon::now()->format('Y-m-d H:i:s');
// Initialize payment
$inputData = [
'reference' => 'order_123',
'amount' => 1599.00,
'currency' => 'ZAR',
'returnUrl' => 'https://example.com/return',
'notifyUrl' => 'https://example.com/notify',
'transactionDate' => $transactionDate,
'locale' => 'en-za',
'country' => 'ZAF',
'email' => '[email protected]',
];
$response = $client->initiatePayment($inputData);
// Generate the payment form
$formHtml = $client->createForm();
// Display the payment form to the user
echo $formHtml;