blaaiz/blaaiz-php-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

blaaiz/blaaiz-php-sdk

最新稳定版本:v1.0.7

Composer 安装命令:

composer require blaaiz/blaaiz-php-sdk

包简介

Official framework-agnostic PHP SDK for the Blaaiz RaaS (Remittance as a Service) API

README 文档

README

Framework-agnostic PHP SDK for the Blaaiz RaaS (Remittance as a Service) API.

Installation

composer require blaaiz/blaaiz-php-sdk

Quick Start

OAuth 2.0

<?php

require __DIR__ . '/vendor/autoload.php';

use Blaaiz\PhpSdk\Blaaiz;

$blaaiz = new Blaaiz([
    'client_id' => 'your-client-id',
    'client_secret' => 'your-client-secret',
    'base_url' => 'https://api-dev.blaaiz.com',
]);

$currencies = $blaaiz->currencies()->list();

Legacy API key

<?php

require __DIR__ . '/vendor/autoload.php';

use Blaaiz\PhpSdk\Blaaiz;

$blaaiz = new Blaaiz([
    'api_key' => 'your-api-key',
    'base_url' => 'https://api-dev.blaaiz.com',
]);

$wallets = $blaaiz->wallets()->list();

When both OAuth credentials and an API key are provided, OAuth is used.

Configuration

The SDK constructor accepts:

[
    'api_key' => '...',
    'client_id' => '...',
    'client_secret' => '...',
    'oauth_scope' => 'wallet:read currency:read ...',
    'base_url' => 'https://api-dev.blaaiz.com',
    'timeout' => 30,
]

Available Services

  • customers()
  • collections()
  • payouts()
  • wallets()
  • virtualBankAccounts()
  • transactions()
  • banks()
  • currencies()
  • fees()
  • files()
  • webhooks()
  • rates()
  • swaps()

These services are also exposed as public properties, for example $blaaiz->customers.

Common Examples

Create a customer

$customer = $blaaiz->customers()->create([
    'first_name' => 'John',
    'last_name' => 'Doe',
    'type' => 'individual',
    'email' => 'john.doe@example.com',
    'country' => 'NG',
    'id_type' => 'passport',
    'id_number' => 'A12345678',
]);

Initiate a payout

$payout = $blaaiz->payouts()->initiate([
    'wallet_id' => 'wallet-id',
    'customer_id' => 'customer-id',
    'method' => 'bank_transfer',
    'from_currency_id' => 'USD',
    'to_currency_id' => 'NGN',
    'from_amount' => 100,
    'bank_id' => 'bank-id',
    'account_number' => '0123456789',
]);

Upload a KYC document

$result = $blaaiz->customers()->uploadFileComplete('customer-id', [
    'file' => __DIR__ . '/passport.pdf',
    'file_category' => 'identity',
]);

Verify a webhook

$event = $blaaiz->webhooks()->constructEvent(
    file_get_contents('php://input'),
    $_SERVER['HTTP_X_BLAAIZ_SIGNATURE'] ?? '',
    $_SERVER['HTTP_X_BLAAIZ_TIMESTAMP'] ?? '',
    'your-webhook-secret'
);

API Reference

Runnable Examples

See examples/README.md for runnable sample scripts.

High-Level Helpers

The root SDK object includes:

  • testConnection()
  • createCompletePayout(array $config)
  • createCompleteCollection(array $config)

These helpers compose the lower-level services for common workflows.

Error Handling

use Blaaiz\PhpSdk\Exceptions\BlaaizException;

try {
    $blaaiz->currencies()->list();
} catch (BlaaizException $e) {
    var_dump($e->toArray());
}

Development

composer install
composer test
composer analyse

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固