UQPAY 沙盒环境让你能在不产生真实交易的前提下测试集成。以下所有测试凭据仅在沙盒环境中可用。
测试卡号
使用下列测试卡调用 Create Payment Intent API。card_name 可填任意值(例如 “John Doe”)。
network 字段使用小写:mastercard、visa、unionpay。卡号中不要带空格。若收到 product_not_found 错误,请联系 UQPAY 技术支持。
| 卡组织 | 卡号 | 有效期 | CVC | 支持的模式 |
|---|
| Mastercard | 5413330057004047 | 12/25 | 989 | online、offline |
| Mastercard | 5346930100108117 | 12/26 | 811 | online、offline |
| Visa | 4176660000000027 | 12/33 | 303 | offline(POS) |
| UnionPay | 6250947000000014 | 12/33 | 123 | online、offline |
卡支付请求示例
{
"amount": "8.98",
"currency": "SGD",
"payment_method": {
"type": "card",
"card": {
"card_name": "UQPAY",
"card_number": "5346930100108117",
"expiry_month": "12",
"expiry_year": "2026",
"cvc": "811",
"network": "mastercard",
"billing": {
"first_name": "UQPAY",
"last_name": "ACQ",
"email": "[email protected]",
"phone_number": "0524-91353515",
"address": {
"country_code": "SG",
"state": "Singapore",
"city": "Singapore",
"street": "444 Orchard Rd, Midpoint Orchard, Singapore",
"postcode": "924011"
}
},
"auto_capture": true,
"authorization_type": "authorization",
"three_ds_action": "skip_3ds"
}
},
"merchant_order_id": "test-order-001",
"description": "test",
"metadata": {},
"return_url": "https://example.com/callback"
}
电子钱包沙盒测试
AlipayCN 与 AlipayHK
准备工作
方式 A:自行注册账户
方式 B:使用共享测试账户
- 从此处安装 Alipay 测试钱包 App AWallet。
- 在此处注册一个 Alipay 沙盒账户。
- 从此处安装 Alipay 测试钱包 App AWallet。
- 联系技术支持获取测试账户凭据。
二维码流程
发送带 flow: "qrcode" 和 is_present: false 的支付请求:
{
"amount": "7.77",
"currency": "SGD",
"payment_method": {
"type": "alipaycn",
"alipaycn": {
"flow": "qrcode",
"is_present": false
}
},
"merchant_order_id": "alipay-qr-test-001",
"description": "acquiring sandbox testing",
"metadata": {},
"return_url": "https://example.com/callback"
}
响应会返回 intent_status: "REQUIRES_CUSTOMER_ACTION",并在 next_action.display_qr_code 中包含二维码 URL。在浏览器中打开 qr_code_url,用 AWallet App 扫码完成支付。
付款码流程(线下)
线下付款码场景将 is_present 设为 true,并带上客户的 payment_code:
- 打开 AWallet App,点击 “Payment Code”。
- 点击条形码查看付款码数字。
- 在 API 请求中使用该付款码:
{
"amount": "1.11",
"currency": "SGD",
"payment_method": {
"type": "alipaycn",
"alipaycn": {
"flow": "qrcode",
"os_type": "ios",
"is_present": true,
"payment_code": "284057804613761079"
}
},
"merchant_order_id": "alipay-paycode-test-001",
"description": "acquiring sandbox testing",
"metadata": {},
"return_url": "https://example.com/callback"
}
付款码交易会立即完成 —— 响应会返回 intent_status: "SUCCEEDED"。
Webhook 测试
测试 webhook 送达的步骤:
- 在 UQPAY 控制台配置你的 webhook URL。
- 发起一笔沙盒交易(卡支付或电子钱包)。
- 确认你的服务器收到了 webhook 通知。
- 返回 HTTP 200 以确认接收。
Webhook payload schema 参见 Webhooks 标签页。
生产上线检查清单
切换到生产环境前: