Official PHP SDK for the IzichangePay API.

Maintainers

Package info

github.com/cryptogateway-project/izichangepay-sdk-php

Homepage

pkg:composer/izichangepay/sdk

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-06-09 11:46 UTC

This package is auto-updated.

Last update: 2026-06-09 15:13:09 UTC


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-Key on 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