Files
qianyubtcandClaude Fable 5 f87ec65541 BinancePayTool v0.1.0:币安支付个人收款网关(Go 核心 + 四语言 SDK)
- Go 服务端:唯一金额/备注码/回填订单编号三路匹配、托管收银页、HMAC 回调七级重试、SQLite 单二进制
- SDK:Go / Java / PHP / Python,共享签名测试向量(docs/test_vectors.json)
- 跨语言 e2e(真实二进制 × Python SDK × mock 币安)、GitHub Actions CI、Dockerfile
- 协议文档 docs/protocol.md、调研与实测结论 docs/research.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-02 14:09:32 +08:00

15 lines
555 B
PHP

<?php
/* 最小商户示例:创建订单并跳转收银页。
php -S 127.0.0.1:9000 后访问 http://127.0.0.1:9000/index.php */
require __DIR__ . '/../../sdk/php/BPayGate.php';
$gw = new BPayGate(getenv('BPG_BASE') ?: 'http://127.0.0.1:8080', getenv('BPG_SECRET') ?: '');
$order = $gw->createOrder([
'merchant_order_id' => 'DEMO-' . time(),
'currency' => 'USDT',
'amount' => '1',
'callback_url' => 'https://你的域名/notify.php',
'return_url' => 'https://你的域名/done.php',
]);
header('Location: ' . $order['pay_url']);