aryan-developer / zibal
There is no license information available for the latest version (1.0) of this package.
a simple library for zibal
1.0
2024-01-16 14:27 UTC
Requires
- php: >=8.2
- ext-curl: *
README
use this library for download from SoundCloud Easily
Installation
Recommended way of installing this is via Composer:
composer require aryan-developer/zibal
Run locally:
php -S localhost:8000
Usage
Request
<?php use Aryandev\zibal\Zibal; use Aryandev\zibal\ZibalException; require_once "./vendor/autoload.php"; $zibal = new Zibal("65xxxxxxx0d", "https://example.ir/verify.php"); try { $zibal->request(amount: 10000,redirect: true); } catch (ZibalException $e) { echo "<pre>{$e->getZibalMessage()}</pre>"; } ?>
Verify
<?php use Aryandev\zibal\Zibal; use Aryandev\zibal\ZibalException; require_once "./vendor/autoload.php"; if($_GET['success']==1) { $zibal = new Zibal("65a1498fc5d2cb001d8d540d", "https://example.ir/verify.php"); try { $response = $zibal->verify($_GET['trackId']); var_dump($response); } catch (ZibalException $e) { echo $e->getZibalResultCode(); } }else{ echo "پرداخت با شکست مواجه شد."; }