支付 API
支付通过结账流程处理。支付网关由配置决定。
GET /api/v1/payments/:idAuthorization: Bearer <token>POST /api/v1/payments/:id/refundAuthorization: Bearer <admin_token>{ "amount": 50.00, "reason": "Customer request"}支持部分退款。
Airwallex(主网关)
Section titled “Airwallex(主网关)”Airwallex 使用 client ID + API key 对认证(不是账户密钥),另加 webhook secret:
[payment]default_gateway = "airwallex"
[payment.airwallex]enabled = trueclient_id = "…" # Airwallex 控制台获取api_key = "…" # Airwallex 控制台获取webhook_secret = "…" # 校验 webhook 签名demo = true # true = api.sandbox.airwallex.com,false = 生产demo = true指向https://api.sandbox.airwallex.com/api/v1;demo = false指向https://api.airwallex.com/api/v1。- 支持银行卡、微信支付、支付宝、3D Secure。
- 结账响应包含
payment_intent_id/client_secret和airwallex_env提示(demo/prod),客户端可据此把 Drop-in 挂载到匹配的环境。 - 结算记录(费用、批次 ID)通过
POST /api/v1/accounting/sync-settlements汇入 会计导出。
Stripe(遗留)
Section titled “Stripe(遗留)”仍可用。Secret key:sk_test_... / sk_live_...;publishable
key:pk_test_... / pk_live_...。支持银行卡、Apple Pay、Google
Pay、3D Secure。
Mock(测试)
Section titled “Mock(测试)”测试始终可用。模拟成功支付。设置 default_gateway = "mock" 即可
使用。
Webhooks
Section titled “Webhooks”支付状态变化会触发 webhook:
payment.succeededpayment.failedrefund.succeeded
通过管理后台或 API 注册 webhook 端点。