You can install the package via composer:
composer require dpsoft/pay.ir
copy sample
directory to server. Open request.php
in browser and bala balah ...
try {
$pay = new \Dpsoft\Pay\Pay($apiKey);
$result = $pay->request($callbackUrl,$amount);
//save amount and invoice id to forther use
$_SESSION['amount']=$amount;
$_SESSION['invoice_id']=$result['invoice_id'];
$pay->redirectToBank();
exit();
}catch (Throwable $exception){
echo $exception->getMessage();
}
try {
$pay = new \Dpsoft\Pay\Pay();
$result = $pay->verify($_SESSION['amount'],$_SESSION['invoice_id']);
//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.