izichangepay/sdk
最新稳定版本:v0.1.0
Composer 安装命令:
composer require izichangepay/sdk
包简介
Official PHP SDK for the IzichangePay API.
README 文档
README
Official PHP SDK for the IzichangePay API. PHP ≥ 7.4, only ext-curl + ext-json.
composer require izichangepay/sdk
Usage
<?php use Izichangepay\Client; use Izichangepay\Http; $izipay = new Client(getenv('IZIPAY_API_KEY')); // Sandbox: new Client(getenv('IZIPAY_API_KEY'), Http::SANDBOX_BASE_URL); $intent = $izipay->paymentIntents->create([ 'requestedCurrencyType' => 'fiat', 'currencyRequested' => 'XOF', 'amountRequested' => '10000', 'acceptedCoins' => ['USDT.TRC20'], ]); echo $intent['paymentUrl'];
Pagination
foreach ($izipay->paymentIntents->iterate(['limit' => 50]) as $intent) { echo $intent['id'], PHP_EOL; }
Verifying a webhook
<?php use Izichangepay\Webhooks; use Izichangepay\WebhookException; $rawBody = file_get_contents('php://input'); // raw body, not a parsed array try { $event = Webhooks::validate( $rawBody, $_SERVER['HTTP_X_IZIPAY_SIGNATURE'] ?? null, getenv('IZIPAY_WEBHOOK_SECRET') ); // handle $event['type'] / $event['data'] http_response_code(200); } catch (WebhookException $e) { http_response_code(400); // reject: $e->reason }
Errors
All exceptions extend Izichangepay\IzichangepayException. Specific types:
AuthException (401/403), NotFoundException (404), ValidationException
(422, ->fields), RateLimitException (429, ->retryAfter), ServerException
(5xx), NetworkException, WebhookException.
Features
- Bearer auth, auto JSON (de)serialization
- Auto
Idempotency-Keyon POST, retry on 429/5xx/network with backoff + jitter - Constant-time webhook signature verification + anti-replay window
- Cursor pagination iterators
Documentation
Full reference: https://docs.pay.izichange.com/developers/sdks/php
License
MIT
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-06-09