farsidesign / laravel-zarinpal
Zarinpal Transaction Library for Laravel
dev-master
2017-04-19 17:13 UTC
This package is not auto-updated.
Last update: 2025-01-05 02:41:41 UTC
README
Zarinpal Transaction Library for Laravel
##installation
"require": { ... "farsidesign/laravel-zarinpal" : "dev-master", ... },
Add provider to providers list in "config/app.php":
'providers' => [ ... Farsidesign\Laravel\ZarinpalServiceProvider::class, ... ]
##usage
##request
use Farsidesign\Zarinpal; $zarinpal = new Zarinpal('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'); $result = $zarinpal->request("http://example.com/verify.php", 1000, 'Description'); if(isset($result['Authority'])) { return $zarinpal->redirect($result['Authority']); }
##verify
use Farsidesign\Zarinpal; $zarinpal = new Zarinpal('XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'); return $zarinpal->verify(Status, 1000, Authority); //'Status'(index) going to be 'success', 'error' or 'canceled'