Download the PHP package zayono/zayono-php without Composer
On this page you can find all versions of the php package zayono/zayono-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zayono/zayono-php
More information about zayono/zayono-php
Files in zayono/zayono-php
Package zayono-php
Short Description Official PHP SDK for the Zayono unified Mobile Money payment gateway.
License MIT
Homepage https://github.com/RomualdAKM/zayono-php
Informations about the package zayono-php
Zayono PHP SDK
Official PHP SDK for Zayono, the unified Mobile Money payment gateway for Africa.
Wraps the Zayono REST API with authentication, automatic retries, idempotency, lazy pagination, typed exceptions, and webhook signature verification.
- Package:
zayono/zayono-php - Source: github.com/RomualdAKM/zayono-php
- Documentation: docs.zayono.com/sdks/php
Requirements
- PHP 8.1 or higher
- ext-json
- Guzzle 7 (or any PSR-18 HTTP client)
Installation
Quick start
Configuration
The environment (sandbox vs live) is derived server-side from the API key prefix:
zyn_test_*keys produce sandbox-environment transactionszyn_live_*keys produce production transactions
Examples
1. Initialize a payment
2. Retrieve and verify a payment
3. Send a payout
Refunds: the public API-key v1 surface does not yet expose
POST /v1/payments/{id}/refunds. For now, trigger refunds from the Zayono merchant dashboard. Arefundsresource will be added to this SDK once the endpoint ships on the v1 surface.
4. Verify a webhook signature
5. Paginate through every payment
For a single page:
Idempotency
Every POST, PATCH, PUT, and DELETE request automatically receives a fresh X-Idempotency-Key (UUID v4) so retried calls never double-process a transaction. Override the key explicitly when you need to:
Retries
Transient failures are retried 3 times by default with exponential backoff (250 ms → 1 s → 4 s):
- Network errors (DNS, connect, timeout)
- HTTP 429 (respects
Retry-After) - HTTP 502 / 503 / 504
4xx responses (other than 429) are never retried.
Error handling
Every API error is mapped to a typed exception extending Zayono\Exceptions\ZayonoException:
Every exception exposes:
getStatusCode(): ?int: HTTP status (when applicable)getErrors(): ?array: server-sideerrorsenvelope fieldgetRequestId(): ?string:X-Request-Idheader value for support tickets
Logging
The SDK accepts any PSR-3 logger. Requests log at info; 4xx/5xx and retries log at warning.
PSR-18 / custom HTTP clients
Swap Guzzle for any PSR-18 implementation by passing it to the constructor:
Testing
License
MIT © Zayono
All versions of zayono-php with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.5
psr/http-client Version ^1.0
psr/http-message Version ^1.1 || ^2.0
psr/log Version ^1.1 || ^2.0 || ^3.0