定制 nodelapay/nodela 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nodelapay/nodela

最新稳定版本:v1.0.0

Composer 安装命令:

composer require 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.

README 文档

README

Official PHP SDK for the Nodela payment API. Provides a clean, typed interface for creating invoices, verifying payments, and listing transactions.

PHP Version License

Requirements

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.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固