Download the PHP package nombaone/nombaone-php without Composer

On this page you can find all versions of the php package nombaone/nombaone-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nombaone-php

nombaone/nombaone-php

The official PHP SDK for the Nomba One subscription-billing API — recurring billing for Nigeria over card, direct debit, bank transfer, and more, with dunning that recovers and a ledger that never loses a kobo.

Requires PHP 8.2+ and any PSR-18 HTTP client + PSR-17 factories, which the SDK auto-discovers (Guzzle, Symfony HttpClient, Nyholm, …). Server-side only — there is no publishable key.

Quickstart

Grab a sandbox key (nbo_sandbox_…) from the dashboard, set it as NOMBAONE_API_KEY, and you are three objects away from a live subscription:

The client derives the host from your key prefix — nbo_sandbox_… talks to https://sandbox.api.nombaone.xyz, nbo_live_… to https://api.nombaone.xyz.

You pass associative arrays in and receive typed, readonly objects out ($subscription->status, $customer->email) — with your IDE autocompleting every field.

Sandbox first

The sandbox runs the real billing engine. $nomba->sandbox->* gives you the levers to make a month happen in a second:

These methods throw locally (before any network call) if used with a live key.

Money is integer kobo

Every amount in the API is an integer in kobo: ₦1.00 = 100. 250_000 is ₦2,500 — not ₦250,000. No floats, no decimal strings, currency is always "NGN". Multiply naira by 100 exactly once, at the edge of your system; every money field is suffixed InKobo so a mixup is hard to type.

Pagination

Every list() works three ways:

Errors are a feature

Failures throw typed exceptions carrying everything the API said — the stable errorCode to branch on, a hint telling you exactly what to do next (folded into the message), a docUrl into the error reference, per-field details on validation failures, and the requestId to quote to support:

PHP's \Exception reserves $code for its own numeric code, so the machine-readable error code is on $e->errorCode. Compare it against the NombaOne\ErrorCode constants.

Status Exception Notes
400 BadRequestException malformed request
401 AuthenticationException missing / invalid / wrong-environment key
403 PermissionDeniedException missing scope, foreign resource
404 NotFoundException wrong id or wrong environment
409 ConflictException state conflicts, idempotency reuse
422 ValidationException $e->fields has the per-field messages
429 RateLimitException $e->retryAfter, $e->limit, $e->remaining
5xx ServerException safe to retry (the SDK already did)
— ConnectionException / TimeoutException transport-level

All of these extend NombaOne\Exceptions\ApiException (except the transport ones), which extends NombaOne\Exceptions\NombaOneException — catch the base to handle any SDK error.

Idempotency & retries

The SDK auto-generates an Idempotency-Key for every POST and reuses it across its automatic retries (network failures, timeouts, 408/429/5xx, and its own in-flight idempotency conflict — 2 retries by default, honoring Retry-After), so a blip can never double-charge. Pass your own key when the operation must stay idempotent across process restarts:

Payouts: the Idempotency-Key doubles as the payout's durable merchantTxRef. Always pass an explicit, stable key (e.g. your own payout id) — an auto-generated key protects SDK-level retries, but a brand-new process retrying with a fresh key would create a second payout.

Every method also accepts a per-call options array as its final argument: idempotencyKey, headers, timeout (seconds), maxRetries.

Webhooks

Verify before you parse, and dedupe on the event id — delivery is at-least-once, never exactly-once. The helper needs only the signing secret, never an API key:

constructEvent checks the X-Nombaone-Signature (t=<unix>,v1=<hex>, HMAC-SHA256 over "{t}.{rawBody}") in constant time, rejects stale timestamps (300s tolerance, configurable), and accepts multiple v1= pairs so secret rotation never drops a delivery. generateTestHeader() lets you unit-test your handler.

Capture the raw body before your framework parses it:

Framework Raw body
Laravel $request->getContent()
Symfony $request->getContent()
Slim / PSR-7 (string) $request->getBody()
Plain PHP file_get_contents('php://input')

Manage endpoints via $nomba->webhookEndpoints (create/rotate return the secret exactly once).

The full surface

customers (+credit, discount) · plans (+nested prices) · prices · subscriptions (pause/resume/cancel/resubscribe/change, schedule, dunning, upcoming invoice, events) · invoices · coupons · paymentMethods (hosted-checkout cards, virtual accounts) · mandates (NIBSS direct debit) · settlements (escrow, refunds, payouts) · webhookEndpoints (+deliveries, replay) · events (+catalog) · organization (+billing policy) · metrics · sandbox — every operation in the API reference, 1:1.

Worth knowing:

Configuration

$apiKey defaults to NOMBAONE_API_KEY. You can also pass a single options array: new Nombaone(['apiKey' => …, 'timeout' => 10]). Read-only $nomba->mode and $nomba->baseUrl reflect the resolved environment.

Examples & development

Runnable scripts live in examples/ — quickstart, pagination, the subscription lifecycle, a webhook receiver, and a dunning rehearsal with the test clock. To develop the SDK itself:

Requirements & versioning

PHP ≥ 8.2 (tested on 8.2, 8.3, 8.4). Semantic versioning; the API itself is versioned at /v1 and additive changes never break you. MIT licensed. Copyright © Nomba One.


All versions of nombaone-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1 || ^2.0
php-http/discovery Version ^1.19
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nombaone/nombaone-php contains the following files

Loading the files please wait ...