Download the PHP package barkapay/payhub-php without Composer
On this page you can find all versions of the php package barkapay/payhub-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download barkapay/payhub-php
More information about barkapay/payhub-php
Files in barkapay/payhub-php
Package payhub-php
Short Description Official PHP SDK for the PayHub payments API — mobile money & crypto, one API across countries.
License MIT
Homepage https://payhub.africa/developers
Informations about the package payhub-php
PayHub PHP SDK
Official PHP client for the PayHub payments API — mobile money & crypto, one API across countries.
- Zero dependencies (just
ext-curl+ext-json) — safe to embed inside WordPress / WooCommerce. - Typed payments, transfers and balance objects.
- Built-in webhook signature verification.
- Automatic retries on transient errors.
Requirements
PHP 8.1+ with the curl and json extensions.
Install
Quick start
Authentication: pass the raw
key_id:secret(orkeyId+secretseparately). The SDK adds theBearerprefix — never include the wordBeareryourself.
Payments
The flow depends on the operator — always branch on the returned status:
synchronous (SUCCESSFUL/FAILED), AWAITING_OTP (confirm step), or
PROCESSING_OPERATOR (final outcome arrives by webhook).
Transfers
Balance & operators
Webhooks
Verify the PayHub-Signature header against the raw request body:
Errors
Every API error throws a typed exception extending PayHub\Exception\ApiException
(getErrorCode(), getHttpStatus(), getRequestId(), getErrors()):
| Exception | When |
|---|---|
AuthenticationException |
401 — bad credentials |
AuthorizationException |
403/410/451 — not allowed |
ValidationException |
422 — bad request (getErrors()) |
NotFoundException |
404 |
ConflictException |
409 — duplicate |
RateLimitException |
429 |
ServiceUnavailableException |
503 — retryable |
NetworkException |
request never reached a response |
Catch everything from the SDK with PayHub\Exception\PayHubException.
Configuration
License
MIT.
All versions of payhub-php with dependencies
ext-curl Version *
ext-json Version *