You can install the package via composer:
composer require dpsoft/zibal
copy sample
directory to server. Open request.php
in browser and bala balah ...
try {
$zibal = new \Dpsoft\Zibal\Zibal($merchant);
$result = $zibal->request($callbackUrl,$amount);
//save amount and invoice id to forther use
$_SESSION['amount']=$amount;
$_SESSION['token']=$result['token'];
$zibal->redirectToBank();
exit();
}catch (Throwable $exception){
echo $exception->getMessage();
}
try {
$zibal = new \Dpsoft\Zibal\Zibal($merchant);
$result = $zibal->verify($_SESSION['amount'],$_SESSION['token']);
//save result. The keys are: card_number,transaction_id and token for example $result['token']
echo "Successfull transaction.";
}catch (Throwable $exception){
echo "Error in transaction: ";
}
composer test
If you discover any security related issues, please email info@dpsoft.ir instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.