1. Go to this page and download the library: Download dizatech/pasargad_ipg 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/ */
dizatech / pasargad_ipg example snippets
$args = [
'username' => '123',
'password' => '456',
'terminal_number' => '789',
]; //Replace arguments with your gateway actual values
$ipg = new Dizatech\PasargadIpg\PasargadIpg($args);
$purchase = $ipg->purchase(
amount: 20000,
invoice_number: 1,
invoice_date: '2024-06-29 10:20:30',
redirect_address: 'http://myaddress.com/verify'
); //Replace arguments with your gateway actual values
if ($purchase->status == 'success') {
header("Location: {$purchase->payment_url}");
exit;
}
$inquiry = $ipg->inquiry(invoice_number: 1);
//Replace arguments with your gateway actual values