nodelapay / nodela
SDK wrapper for Nodela dev api's to aide in implementation of Nodela on javascript/NodeJs servers, by abstracting away the api complexity and providing easy to use interfaces.
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.10
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
This package is not auto-updated.
Last update: 2026-05-02 23:08:42 UTC
README
Official PHP SDK for the Nodela payment API. Provides a clean, typed interface for creating invoices, verifying payments, and listing transactions.
Requirements
- PHP 8.1+
- Composer
- GuzzleHTTP 7.10+
Installation
composer require nodelapay/nodela
Quick Start
use Nodelapay\Nodela\Client; $client = new Client('your-api-key'); // Create an invoice $invoice = $client->invoices->create([ 'amount' => 5000, 'currency' => 'NGN', 'success_url' => 'https://example.com/success', 'cancel_url' => 'https://example.com/cancel', 'customer' => [ 'name' => 'Jane Doe', 'email' => 'jane@example.com', ], ]); // Verify payment status $status = $client->invoices->verify($invoice->getData()['id']); // List transactions $transactions = $client->transactions->list(['page' => 1, 'limit' => 20]);
Configuration
By default the client uses a 30-second timeout and sends standard JSON headers. You can customise both via Config:
use Nodelapay\Nodela\Client; use Nodelapay\Nodela\Config; $config = new Config( apiKey: 'your-api-key', timeout: 60, headers: ['X-Custom-Header' => 'value'], ); $client = new Client('your-api-key', $config);
See docs/configuration.md for all options.
Resources
Invoices
| Method | Description |
|---|---|
create(array $params) |
Create a new payment invoice |
verify(string $invoiceId) |
Check the payment status of an invoice |
Full reference: docs/invoices.md
Transactions
| Method | Description |
|---|---|
list(array $params = []) |
Retrieve and filter transaction history |
Full reference: docs/transactions.md
Error Handling
The SDK throws typed exceptions for every API error:
use Nodelapay\Nodela\Exceptions\AuthenticationException; use Nodelapay\Nodela\Exceptions\ValidationException; use Nodelapay\Nodela\Exceptions\RateLimitException; use Nodelapay\Nodela\Exceptions\ApiException; try { $invoice = $client->invoices->create([...]); } catch (AuthenticationException $e) { // Invalid or missing API key (HTTP 401) } catch (ValidationException $e) { // Bad request data (HTTP 422) $fieldErrors = $e->getErrors(); } catch (RateLimitException $e) { // Rate limit exceeded (HTTP 429) $retryAfter = $e->getRetryAfter(); // seconds } catch (ApiException $e) { // All other API errors $statusCode = $e->getStatusCode(); $body = $e->getResponse(); }
Full reference: docs/error-handling.md
Documentation
| Document | Description |
|---|---|
| Getting Started | Installation, first request, common patterns |
| Configuration | Config class options and custom headers |
| Invoices | Create and verify invoices |
| Transactions | List and filter transactions |
| Error Handling | Exception hierarchy and recovery strategies |
| Supported Currencies | Full list of 60+ supported fiat currencies |
| HTTP Layer | Request/Response internals for advanced use |
| Testing | Running the test suite, writing tests |
Contributing
See CONTRIBUTING.md for guidelines on reporting bugs, submitting pull requests, and running the development toolchain.
Changelog
All notable changes are documented in CHANGELOG.md.
License
MIT — see LICENSE for details.