llms.txt API v1 · 2026-11-02
Go live上线

All test cases全部测试用例

All cases of the conformance test, in execution order.接口对接测试的全部用例,按执行顺序排列。

  • We run these cases from our test console against your Wallet API, usually in the staging environment, before you go live and after any change to your wallet.
  • Every request is a real request signed with your secretKey, sent from our egress IPs, and marked with X-Test-Run. Process it exactly like real traffic.
  • The cases move real money on your test player. They are designed so that the balance ends where it started.
  • You receive a downloadable report (HTML, English and Chinese) with the result of every case.
  • 上线前、以及钱包有任何改动后,平台从测试控制台对商户钱包接口跑这套用例,一般在测试环境。
  • 每个请求都是用商户 secretKey 签名的真实请求,从平台出口 IP 发出,带 X-Test-Run 头。请与正式流量完全一样地处理。
  • 用例会真实动测试玩家的钱,整套设计为跑完余额回到起点。
  • 测试完成后商户会收到一份可下载的报告(HTML,中英双语),列出每条用例的结果。

What you provide商户提供

Item项Requirement要求
Callback URL & key回调地址与密钥Your staging callbackUrl, with our secretKey configured on your side.测试环境的 callbackUrl,商户侧已配好平台给的 secretKey。
One test player一个测试玩家Normal status, balance ≥ 50 × test amount, used only for testing.状态正常,余额 ≥ 50 倍测试金额,只用于测试。
Its test token它的测试 tokenAccepted by /auth repeatedly during the test.测试期间 /auth 可以反复接受。
Test amount (optional)测试金额(可选)A stake your limits accept. Default 1.00, or 1000 for zero-decimal currencies.商户限额能接受的一注。默认 1.00,0 位小数币种默认 1000。

Notation记号

Symbol记号Meaning含义
TKYour test token商户的测试 token
ATest amount; 2A, 4A … are multiples, padded to the currency precision测试金额;2A、4A 等是倍数,按币种精度补齐
P · CTest player's extPlayerId and currency, from AUTH-01测试玩家的 extPlayerId 与币种,由 AUTH-01 得到
C'Another currency enabled on our side平台开通的另一个币种
B0Starting balance, from BAL-01起始余额,由 BAL-01 得到
R0…R24 · T…New wallet rounds and transactions created for this run (normal id format)本轮新生成的钱包局与交易(与正式流量格式相同)
zz_<random>A player id that does not exist不存在的玩家编号

Unless a case says otherwise, requests also carry extPlayerId: P, currency: C, a correct signature, a fresh request id and the current timestamp.

除非用例另有说明,请求都带 extPlayerId: P、currency: C、正确的签名、新的请求编号和当前时间戳。

Checks on every case每条用例都查的项

Besides the expected code and the assertions in its row, every case is checked against all of the following. Any one failing fails the case.

除了表格里那一行的期望 code 与额外断言,每条用例还要全部通过下面几项,任何一项不过这条就失败。

#Check检查
K1HTTP 200; body is a JSON object with a string code.HTTP 200;正文是 JSON 对象,code 是字符串。
K2code equals the expected code exactly, and is allowed for the endpoint (allowed codes per endpoint).code 与期望完全一致,且在该接口允许的范围内(各接口允许的码)。
K3On OK, required data fields are present with the right types; merchantTxnId non-empty, ≤ 64.OK 时 data 必填字段齐全、类型正确;merchantTxnId 非空、≤ 64。
K4Amounts and balances are decimal strings within the currency precision.金额与余额是十进制字符串,小数位不超过币种精度。
K5A balance in the response equals the expected balance exactly.响应里的 balance 精确等于期望余额。
K6After the case, /balance equals the "Balance after" column exactly.用例之后 /balance 精确等于「之后余额」一列。
K7Within the timeout: debit / auth 5 s, balance 3 s, credit / rollback 10 s.不超时:扣款 / 认证 5 秒,余额 3 秒,派彩 / 冲正 10 秒。

Blocking = violates the protocol or poses a risk to funds; must be remediated before go-live. Warning = does not affect the safety of funds; remediation is recommended.阻断级 = 违反协议或存在资金风险,上线前必须整改。警告级 = 不影响资金安全,建议整改。

Order & rules顺序与规则

Cases run one after another in the numbered order below; inside a wallet round, transactions are sent in txnSeq order. Only the concurrency phase sends requests in parallel.

用例按下面的编号顺序逐条执行;同一钱包局内的交易按 txnSeq 依次发送。只有并发那一段会同时发请求。

#Phase阶段Cases用例编号Count条数
1Preparation测试准备#1–77
2Signature and Conventions签名与通用约定#8–1710
3Debit扣款#18–2710
4Multiple Debits per Round单局多笔扣款#28–3710
5Credit派彩#38–403
6Rollback冲正#41–5010
7Boundary Values边界值#51–6010
8Concurrency并发#61–644
9Wrap-up收尾核对#65–673
Rule规则What happens怎么处理
Abort中止AUTH-01, BAL-01 or BAL-04 fails → the run stops; remaining cases are "skipped".AUTH-01、BAL-01、BAL-04 任一不过 → 整轮停止,其余用例记「跳过」。
Skip跳过A case whose prerequisite failed (e.g. DEB-02 after DEB-01) is "skipped", neither passed nor failed.前置用例失败的(如 DEB-01 失败时的 DEB-02)记「跳过」,不算通过也不算失败。
Ledger账本We track the expected balance case by case. If the real balance differs, that case fails and the run continues from the real balance; the difference is shown in the report.平台逐条记期望余额。实际不符时该条失败,之后以实际余额继续,差额写进报告。
Unknown result结果未知A timed-out debit is rolled back immediately, exactly as in production, so the test itself never loses money.扣款超时立即按正式流程冲正,测试本身不会丢钱。
Cleanup清理At the end (or when stopped), every round the test opened and did not close is rolled back debit by debit; listed in the report.结束(或被停止)时,测试打开过、没关的钱包局逐笔冲正,列在报告里。
One run at a time同时一轮Only one run per merchant at a time.同一商户同时只跑一轮。

Not covered: PLAYER_DISABLED (needs a second account), BET_REJECTED (your own risk rules), MAINTENANCE / INTERNAL_ERROR (cannot be triggered on purpose). If any of them appears, K2 still applies.

不测的:PLAYER_DISABLED(需要第二个账号)、BET_REJECTED(商户自己的风控规则)、MAINTENANCE / INTERNAL_ERROR(无法稳定触发)。它们一旦出现,仍按 K2 判。

Cases用例

1. Preparation1. 测试准备 #1–7

Authenticates the test token, reads the opening balance and verifies that the balance is sufficient for the test. A blocking failure in this phase aborts the test.以测试 token 完成认证,读取起始余额,并检查余额是否满足测试需要。本阶段出现阻断级失败时,测试中止。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
1AUTH-01blocking阻断级Authentication with a valid token有效 token 认证/auth {token: TK}OKextPlayerId matches ^[A-Za-z0-9_-]{1,64}$; currency is enabled on the platform; balance is a valid amount. P and C are recorded. A failure aborts the test.extPlayerId 符合 ^[A-Za-z0-9_-]{1,64}$;currency 为平台已开通币种;balance 为合法金额。记录 P 与 C。失败则测试中止。—
2AUTH-02blocking阻断级Authentication with an invalid token无效 token 认证/auth {token: <random>}INVALID_TOKENNo player data is returned.不返回玩家数据。—
3AUTH-03warning警告级Repeated authentication with the same token同一 token 重复认证/auth {token: TK}OKextPlayerId and currency are identical to AUTH-01.extPlayerId 与 currency 与 AUTH-01 一致。—
4BAL-01blocking阻断级Balance query余额查询/balance {P, C}OKbalance equals the balance returned by AUTH-01 and is recorded as B0. A failure aborts the test.balance 与 AUTH-01 返回的余额一致,记为 B0。失败则测试中止。B0
5BAL-02blocking阻断级Balance query for an unknown player不存在玩家的余额查询/balance {zz_<random>, C}PLAYER_NOT_FOUND——
6BAL-03blocking阻断级Balance query with a mismatched currency币种不符的余额查询/balance {P, C'}CURRENCY_MISMATCH——
7BAL-04self-check自检Test balance sufficiency check测试余额充足性检查(no request)—B0 ≥ 50 × A; otherwise the test is aborted and the report states the minimum balance required.B0 ≥ 50 × A;否则测试中止,并在报告中注明所需最低余额。—

2. Signature and Conventions2. 签名与通用约定 #8–17

Deliberately non-compliant requests sent to /balance and /debit. None of them may result in a change of funds.向 /balance 与 /debit 发送构造的不合规请求,均不得引起资金变动。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
8SIG-01blocking阻断级Invalid signature签名错误/balance, last char of X-Signature changedINVALID_SIGNATURE——
9SIG-02blocking阻断级Body altered after signing签名后正文被篡改/balance, currency lower-cased after signingINVALID_SIGNATURE——
10SIG-03blocking阻断级Expired timestamp时间戳过期/balance, X-Timestamp = now − 10 min (correctly signed)TIMESTAMP_EXPIRED——
11SIG-04blocking阻断级Future timestamp时间戳超前/balance, X-Timestamp = now + 10 minTIMESTAMP_EXPIRED——
12SIG-05blocking阻断级Missing signature header缺少签名头/balance without X-SignatureINVALID_SIGNATURE——
13SIG-06warning警告级Invalid merchant code商户编码错误/balance, random X-Merchant-CodeINVALID_SIGNATURE——
14SIG-07blocking阻断级Tolerance of unknown fields未知字段兼容/balance with extra "zzUnknown": 1OK——
15SIG-08blocking阻断级Debit with an invalid signature签名错误的扣款/debit R0 T0 A, wrong signatureINVALID_SIGNATUREThe balance remains unchanged.余额不变。B0
16SIG-09blocking阻断级Same debit resubmitted with a valid signature以正确签名重新提交同一扣款/debit R0 T0 A, same body, correct signatureOKThe request with the invalid signature was not recorded as processed.签名错误的请求未被记为已处理。B0−A
17SIG-10blocking阻断级Closure of wallet round R0关闭钱包局 R0/credit R0 A roundClosedOK—B0

3. Debit3. 扣款 #18–27

Single debits: successful debit, idempotent repeat, content conflict, insufficient balance and persistence of the failed result, invalid input.单笔扣款:成功扣款、幂等重发、内容冲突、余额不足及失败结果的持久化、非法输入。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
18DEB-01blocking阻断级Debit扣款/debit R1 T1 seq1 AOKbalance = B0 − Abalance = B0 − AB0−A
19DEB-02blocking阻断级Idempotent repeat of a debit扣款幂等重发/debit T1, identical bodyOKmerchantTxnId is identical to DEB-01; no second deduction.merchantTxnId 与 DEB-01 一致;未重复扣款。B0−A
20DEB-03blocking阻断级Debit with a reused txnId and a different amount同一交易号不同金额的扣款/debit T1 with amount 2ATXN_CONFLICT—B0−A
21DEB-04blocking阻断级Winning credit closing wallet round R1派彩关闭钱包局 R1(赢局)/credit R1 T2 seq2 2A roundClosedOKbalance = B0 + Abalance = B0 + AB0+A
22DEB-05blocking阻断级Insufficient balance余额不足/debit R2 T3 amount = balance + AINSUFFICIENT_BALANCEdata.balance is present and equals the current balance.响应须携带 data.balance,且与当前余额一致。B0+A
23DEB-06blocking阻断级Persistence of a failed debit result失败结果的持久化/debit T3, identical bodyINSUFFICIENT_BALANCEIdentical to DEB-05.与 DEB-05 一致。B0+A
24DEB-07blocking阻断级Amount exceeding the currency precision超出币种精度的金额/debit R3, one decimal more than the currency allowsINVALID_PARAM—B0+A
25DEB-08blocking阻断级Debit with a mismatched currency币种不符的扣款/debit R3 new T, currency C'CURRENCY_MISMATCH—B0+A
26DEB-09blocking阻断级Debit for an unknown player不存在玩家的扣款/debit R3 new T, extPlayerId zz_<random>PLAYER_NOT_FOUND—B0+A
27DEB-10warning警告级Debit with bet lines and losing settlement带注单明细的扣款与输局结算/debit R3 A, bets 2 × A/2; /credit R3 0 roundClosedOK, OKIf the amount cannot be split in two at the currency precision, the debit is sent without bet lines; the round is still settled as debit A, credit 0.金额在币种精度下无法均分时,扣款不携带注单明细;该局仍按「扣款 A、派彩 0」结算。B0

4. Multiple Debits per Round4. 单局多笔扣款 #28–37

Single-player blackjack scenario: several debits in one wallet round, round closure, handling after closure, mid-round credit and zero-amount credit.模拟单人 21 点:同一钱包局内多笔扣款、关局、关局后的处理、局中派彩与零金额派彩。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
28MUL-01blocking阻断级First debit in a wallet round同一钱包局第 1 笔扣款/debit R4 seq1 main AOK—B0−A
29MUL-02blocking阻断级Second debit in the same wallet round同一钱包局第 2 笔扣款/debit R4 new T seq2 insurance AOKThe debit must not be treated as a duplicate.不得视为重复请求。B0−2A
30MUL-03blocking阻断级Third debit in the same wallet round同一钱包局第 3 笔扣款/debit R4 new T seq3 double 2AOK—B0−4A
31MUL-04blocking阻断级Closing credit关局派彩/credit R4 T9 seq4 4A roundClosed, 3 bet linesOK—B0
32MUL-05blocking阻断级Debit after round closure关局后的扣款/debit R4 new T seq5 AROUND_CLOSED—B0
33MUL-06blocking阻断级Credit after round closure关局后的派彩/credit R4 new T seq5 AROUND_CLOSED—B0
34MUL-07blocking阻断级Idempotent repeat of the closing credit关局派彩幂等重发/credit T9, identical bodyOKmerchantTxnId is identical to MUL-04; no second payment.merchantTxnId 与 MUL-04 一致;未重复派彩。B0
35MUL-08blocking阻断级Mid-round credit局中派彩/debit R5 2A; /credit R5 A roundClosed=false; /credit R5 A roundClosedOK ×3—B0
36MUL-09blocking阻断级Zero-amount credit closing the round零金额派彩关局/debit R6 A; /credit R6 0 roundClosedOK ×2—B0−A
37MUL-10blocking阻断级Round status after a zero-amount credit零金额派彩后的关局状态/debit R6 new T AROUND_CLOSED—B0−A

5. Credit5. 派彩 #38–40

Credits that must be rejected, and restoration of the test balance.应被拒绝的派彩,以及测试余额的复原。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
38CRE-01blocking阻断级Credit for a round without a successful debit无成功扣款钱包局的派彩/credit R7 A roundClosedROUND_NOT_FOUND—B0−A
39CRE-02blocking阻断级Credit with a reused txnId and a different amount同一交易号不同金额的派彩/credit T9 with amount 5ATXN_CONFLICT—B0−A
40CRE-03blocking阻断级Restoration of the test balance测试余额复原/debit R8 A; /credit R8 2A roundClosedOK ×2Offsets the loss of MUL-09.抵补 MUL-09 的输局金额。B0

6. Rollback6. 冲正 #41–50

Debit rollbacks: normal rollback, idempotent repeat, rollback of a debit never received, late debit after rollback, amount mismatch, rollback of one of several debits, rollback after closure, rollback of a failed debit.扣款冲正:正常冲正、幂等重发、冲正未收到的扣款、冲正后迟到的扣款、金额不符、多笔扣款中冲正单笔、关局后冲正、冲正失败的扣款。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
41ROL-01blocking阻断级Debit rollback扣款冲正/debit R9 Ta A; /rollback ref Ta A round_cancelled roundClosedOK ×2—B0
42ROL-02blocking阻断级Idempotent repeat of a rollback冲正幂等重发ROL-01 rollback, identical bodyOKmerchantTxnId is identical; no second refund.merchantTxnId 一致;未重复退款。B0
43ROL-03blocking阻断级Rollback of a debit never received未收到扣款的冲正/rollback R10 ref Tx (never sent) A debit_uncertainTXN_NOT_FOUND—B0
44ROL-04blocking阻断级Late debit after its rollback冲正后迟到的扣款/debit R10 txnId Tx ATXN_ROLLED_BACKNo deduction is made.未发生扣款。B0
45ROL-05blocking阻断级Rollback with a mismatched amount金额不符的冲正/debit R11 Tb 2A; /rollback ref Tb amount AOK, TXN_CONFLICT—B0−2A
46ROL-06blocking阻断级Rollback with the correct amount金额正确的冲正/rollback R11 new T ref Tb 2A roundClosedOK—B0
47ROL-07blocking阻断级Rollback of one debit among several (failed blackjack double)多笔扣款中单笔冲正(21 点加倍失败)/debit R12 main A; /debit R12 Td double A; /rollback ref Td decision_failed; /credit R12 A roundClosedOK ×4—B0
48ROL-08blocking阻断级Rollback after round closure关局后的冲正/rollback R4 ref MUL-01's debitROUND_CLOSED—B0
49ROL-09blocking阻断级Rollback of a failed debit失败扣款的冲正/rollback R2 ref T3 (DEB-05)TXN_NOT_FOUND—B0
50ROL-10warning警告级Rollback referencing another round's debit跨钱包局的冲正/rollback R13 ref ROL-07's main debitTXN_CONFLICT or或 ROUND_CLOSED—B0

7. Boundary Values7. 边界值 #51–60

Smallest currency unit, debit of the full balance, malformed amounts, missing fields, maximum identifier lengths, the inner edge of the timestamp window, bet lines not matching the amount, and an excessive amount. Each case nets to zero.币种最小金额单位、扣款额等于余额、非法金额格式、缺少必填字段、编号最大长度、时间戳窗口内侧、注单明细合计与金额不符、超大金额。每条用例净额为零。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
51BND-01blocking阻断级Smallest currency unit币种最小金额单位/debit R16 one unit (USD 0.01); /credit R16 same amount roundClosedOK ×2Both transactions are posted with the exact amount.两笔交易均按精确金额记账。B0
52BND-02blocking阻断级Debit equal to the full balance扣款额等于余额/debit R17 amount = current balance; /credit R17 same amount roundClosedOK ×2 or或 BET_REJECTEDdata.balance is 0 after the debit. BET_REJECTED (risk limits) is also compliant.扣款后 data.balance 为 0。返回 BET_REJECTED(风控限额)亦视为合规。B0
53BND-03blocking阻断级Amount as a JSON number金额为 JSON 数字/debit R18 "amount": 1.00 (number, not string)INVALID_PARAMNo change of funds.资金不变。B0
54BND-04blocking阻断级Negative amount负数金额/debit R18 "amount": "-1.00"INVALID_PARAMNo change of funds.资金不变。B0
55BND-05blocking阻断级Amount in exponent notation科学计数法金额/debit R18 "amount": "1e2"INVALID_PARAMNo change of funds.资金不变。B0
56BND-06blocking阻断级Missing required field缺少必填字段/debit R18 without currencyINVALID_PARAMNo change of funds.资金不变。B0
57BND-07blocking阻断级Identifiers at maximum length最大长度编号/debit + /credit R19 with roundId and txnId of 32 charactersOK ×2Both transactions are posted.两笔交易均成功记账。B0
58BND-08blocking阻断级Inner edge of the signature time window签名时间窗口内侧边界/balance with X-Timestamp = now − 290 s; /balance with a 64-character X-Request-IdOK ×2Both requests are accepted.两个请求均被接受。B0
59BND-09warning警告级Bet lines not matching the amount注单明细合计与金额不符/debit R20 A with one bet line A/2; /credit R20 A roundClosedOK ×2The debit is posted at amount A.扣款按金额 A 记账。B0
60BND-10warning警告级Debit of an excessive amount超大金额扣款/debit R21 amount 100000000000000.00INSUFFICIENT_BALANCE or或 BET_REJECTEDNo change of funds; no error and no timeout.资金不变,且不得出现错误或超时。B0

8. Concurrency8. 并发 #61–64

The same debit submitted 10 times concurrently; 10 wallet rounds of one player processed concurrently.同一笔扣款并发提交 10 次;同一玩家的 10 个钱包局并发处理。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
61CON-01blocking阻断级Concurrent duplicate debit (10 requests)同一扣款并发重复提交(10 次)/debit R14 T A × 10 in parallelOKAll OK responses carry the same merchantTxnId and the amount is deducted exactly once. INTERNAL_ERROR among the responses is tolerated; any other result code is not.所有 OK 响应的 merchantTxnId 一致,且仅扣款一次。允许夹杂 INTERNAL_ERROR,不允许其他结果码。B0−A
62CON-02blocking阻断级Closure of wallet round R14关闭钱包局 R14/credit R14 A roundClosedOK—B0
63CON-03blocking阻断级Concurrent debits in 10 wallet rounds10 个钱包局并发扣款/debit R15…R24 A each, in parallelOK ×10—B0−10A
64CON-04blocking阻断级Concurrent credits in 10 wallet rounds10 个钱包局并发派彩/credit R15…R24 A roundClosed, in parallelOK ×10—B0

9. Wrap-up9. 收尾核对 #65–67

Cleans up wallet rounds left open, evaluates response times and verifies that the closing balance equals the opening balance.清理未关闭的钱包局,统计响应时间,并核对期末余额与起始余额一致。

#IDLevel级别Case用例Request请求Expected code期望结果码Also verified附加核对Balance after执行后余额
65PERF-01warning警告级P99 response timeP99 响应时间all wallet requests of the run—P99 < 1000 msP99 < 1000 ms—
66PERF-02blocking阻断级Request timeouts请求超时all wallet requests of the run—No request exceeds its time limit (/debit and /auth 5 s, /balance 3 s, /credit and /rollback 10 s).所有请求均未超过时限(/debit 与 /auth 5 秒,/balance 3 秒,/credit 与 /rollback 10 秒)。—
67END-01blocking阻断级Closing balance reconciliation期末余额核对/balance {P, C}OKbalance = B0. A difference indicates a duplicated or missing fund movement.balance = B0。存在差额表明有重复或缺失的资金变动。B0

The report测试报告

After the run you receive one HTML file (English and Chinese) and the raw data as JSON. The report contains: the verdict (passed / failed / aborted) with counts; the environment (callback URL, test player, amount, our egress IP, start and end balance); a must fix list of blocking failures with expected vs actual and a fix hint linked to the guide; every case with its requests and responses; latency per endpoint; and the cleanup performed.

测试完成后商户会收到一个 HTML 文件(中英双语)和 JSON 原始数据。报告包含:结论(通过 / 不通过 / 中止)与计数;环境(回调地址、测试玩家、金额、平台出口 IP、起止余额);必须修复清单(阻断级失败的期望与实际、修复提示并链到接入文档);每条用例及其请求与响应;各接口时延;执行过的清理。