- 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>
714 B
714 B
BinancePayTool PHP SDK
单文件 BPayGate.php,PHP 7.4+,需 curl 扩展。
require 'BPayGate.php';
$gw = new BPayGate('https://pay.example.com', '你的API_AUTH_KEY');
$order = $gw->createOrder([
'merchant_order_id' => 'SHOP-1001',
'currency' => 'USDT',
'amount' => '10',
'callback_url' => 'https://shop.example.com/bpg_notify.php',
]);
header('Location: ' . $order['pay_url']);
回调:BPayGate::verifyCallback(getallheaders(), file_get_contents('php://input'), $secret),
通过返回数组、失败抛异常;按 merchant_order_id 幂等发货后回 200。
完整字段见 docs/protocol.md。示例:examples/php。