1. Go to this page and download the library: Download pwparsons/paygate 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/ */
pwparsons / paygate example snippets
// Initiate transaction
$http = PayGate::initiate()
->withReference('pgtest_123456789')
->withAmount(32.99)
->withEmail('[email protected]')
->withCurrency('USD') // Optional: defaults to ZAR
->withCountry('USA') // Optional: defaults to ZAF
->withLocale('en-us') // Optional: defaults to 'en'
->withReturnUrl('https://website.com/return_url')
->withNotifyUrl('https://website.com/notify_url') // Optional
->create();
if ($http->fails()) {
dump($http->getErrorCode());
dump($http->getErrorMessage());
dump($http->all());
}
// Redirect to PayGate's payment page
return PayGate::redirect();