该软件包最新版本(1.0)没有提供许可证信息。

一个简单的zibal库

1.0 2024-01-16 14:27 UTC

This package is auto-updated.

Last update: 2024-09-16 16:17:57 UTC


README

使用此库轻松从SoundCloud下载

安装

推荐使用Composer进行安装

composer require aryan-developer/zibal

本地运行

php -S localhost:8000

用法

请求

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

验证

<?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 "پرداخت با شکست مواجه شد.";
}