支付会话(Payment Session)是 StablePay 支付流程的核心概念,代表一次完整的支付请求。
支付会话是一个临时的支付容器,包含:
| 状态 | 说明 |
|---|
PENDING | 等待付款 |
PROCESSING | 处理中(已检测到链上交易) |
COMPLETED | 支付完成 |
EXPIRED | 已过期 |
CANCELLED | 已取消 |
curl -X POST https://api.stablepay.co/v1/payment/sessions \
-H "Authorization: Bearer sk_test_..." \
-d '{
"merchant_id": "merchant_123",
"order_id": "order_001",
"amount": {"value": "10000", "currency": "USDT"}
}'
- 商户创建支付会话
- 用户跳转到支付页面或扫码支付
- StablePay 监听链上交易
- 确认后通知商户(Webhook)
- 商户完成订单处理
Payment Session is the core concept in StablePay's payment flow, representing a complete payment request.
A payment session is a temporary payment container containing:
- Payment amount and currency
- Merchant order information
- Receiving address
- Expiration time
| Status | Description |
|---|
PENDING | Awaiting payment |
PROCESSING | Processing (on-chain transaction detected) |
COMPLETED | Payment completed |
EXPIRED | Expired |
CANCELLED | Cancelled |
curl -X POST https://api.stablepay.co/v1/payment/sessions \
-H "Authorization: Bearer sk_test_..." \
-d '{
"merchant_id": "merchant_123",
"order_id": "order_001",
"amount": {"value": "10000", "currency": "USDT"}
}'
- Merchant creates payment session
- User redirects to payment page or scans QR code
- StablePay monitors on-chain transactions
- Notifies merchant upon confirmation (Webhook)
- Merchant completes order processing