沙盒 · 可模拟的卡交易场景清单
商户自身
只在沙盒环境存在;用 live 凭据调它返回 404(不是 403 —— 在生产上
这个能力根本不该存在)。判据是本次令牌解析到的商户是不是影子主体。
每一档都带一句 expect:这一档预期会发生什么。它就是我方内部
用来断言的那句话的原文,请拿它当验收标准,而不是拿状态码。
清单会随我方新增场景增长,不要把它写死在你的代码里。
响应
200OK(不分页)
{
"data": [
{
"key": "auth_ok",
"label": "消费成功(授权+入账)",
"category": "issuing",
"type": "transaction",
"expect": "过⑤号凭证 · 已使用额度 +金额 · 可用额度 −金额 · 不计风控"
},
{
"key": "chargeback",
"label": "拒付争议(2006)",
"category": "issuing",
"type": "transaction",
"expect": "记一条 chargeback 风控事件 · 免罚 0 次 · 每次 10 USD · 3 次冻卡"
}
],
"next_cursor": null,
"has_more": false
}404不在沙盒环境
请求
curl -X GET 'https://api.zise.com/v1/sandbox/card-scenarios' \
-H 'x-auth-token: Bearer $TOKEN'const res = await fetch("https://api.zise.com/v1/sandbox/card-scenarios", {
method: "GET",
headers: {
"x-auth-token": "Bearer $TOKEN",
},
});
// 金额按字符串读,别让它变成 number
const data = await res.json();import requests
res = requests.get(
"https://api.zise.com/v1/sandbox/card-scenarios",
headers={
"x-auth-token": "Bearer $TOKEN",
},
)
# 金额用 Decimal(str(...)),不要 float
data = res.json()req, _ := http.NewRequest("GET", "https://api.zise.com/v1/sandbox/card-scenarios",
nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
res, err := http.DefaultClient.Do(req)
// 金额字段用 string 接,不要 float64HttpRequest req = HttpRequest.newBuilder()
.uri(URI.create("https://api.zise.com/v1/sandbox/card-scenarios"))
.header("x-auth-token", "Bearer $TOKEN")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
// 金额字段用 String / BigDecimal,不要 double$ch = curl_init('https://api.zise.com/v1/sandbox/card-scenarios');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'x-auth-token: Bearer $TOKEN',
],
]);
$res = curl_exec($ch);
// 金额用 bcmath / 字符串,不要 floatval
200
{
"data": [
{
"key": "auth_ok",
"label": "消费成功(授权+入账)",
"category": "issuing",
"type": "transaction",
"expect": "过⑤号凭证 · 已使用额度 +金额 · 可用额度 −金额 · 不计风控"
},
{
"key": "chargeback",
"label": "拒付争议(2006)",
"category": "issuing",
"type": "transaction",
"expect": "记一条 chargeback 风控事件 · 免罚 0 次 · 每次 10 USD · 3 次冻卡"
}
],
"next_cursor": null,
"has_more": false
}