zenobank/sdk 问题修复 & 功能扩展

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

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

zenobank/sdk

最新稳定版本:v1.5.0

Composer 安装命令:

composer require zenobank/sdk

包简介

ZenoBank PHP SDK for payment checkout and webhook verification

README 文档

README

The official PHP SDK for ZenoBank's Crypto Payment Gateway API. Accept crypto payments with checkout sessions and verify webhooks.

Installation

composer require zenobank/sdk

Usage

Initialize the client

use ZenoBank\Sdk\ZenoBankClient;

$client = new ZenoBankClient('your-api-key');

Create a checkout

$checkout = $client->checkouts->create([
    'order_id' => 'order-123',
    'price_amount' => '10.00',
    'price_currency' => 'USD',
    'success_redirect_url' => 'https://example.com/success',
]);

// Redirect the customer
header('Location: ' . $checkout->checkout_url);

Verify webhooks

use ZenoBank\Sdk\Exceptions\WebhookVerificationError;
use ZenoBank\Sdk\Types\Generated\CheckoutStatus;
use ZenoBank\Sdk\Types\WebhookEvent;

$payload = file_get_contents('php://input');
$headers = getallheaders();
$secret = 'whsec_...';

try {
    $client->webhooks->verify($payload, $secret, $headers);
    $event = WebhookEvent::from_array(json_decode($payload, true));

    if ($event->data->status === CheckoutStatus::COMPLETED) {
        // Payment received
    }
} catch (WebhookVerificationError $e) {
    // Invalid signature or missing headers
    http_response_code(400);
}

Get a checkout

$checkout = $client->checkouts->get('ch_0gJfH4a9B2Eg1jpES');

统计信息

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

GitHub 信息

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

其他信息

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