Skip to content

dpsoft-official/zibal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zibal online payment - درگاه پرداخت Zibal به زبان PHP

Latest Version on Packagist Total Downloads

Installation

You can install the package via composer:

composer require dpsoft/zibal

Usage

copy sample directory to server. Open request.php in browser and bala balah ...

Request

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();
}

Response

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: ";
}

Testing

composer test

Security

If you discover any security related issues, please email info@dpsoft.ir instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Zibal online payment - درگاه پرداخت Zibal به زبان PHP

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages