Implemented by the merchant · called by the platform商户实现 · 平台调用 · timeout超时 10 s
Reverse exactly one debit. Common and transaction fields (amount = amount of the referenced debit), plus:
冲正恰好一笔扣款。公共字段与交易字段(amount = 被冲正扣款的金额),另加:
refTxnIdstring
The txnId of the debit to reverse.被冲正的那笔扣款的 txnId。
rollbackReasonstring
debit_uncertain (the debit's result was unknown) · decision_failed (a mid-round decision did not go through) · round_cancelled (the platform cancelled the round)debit_uncertain 扣款结果未知 · decision_failed 局中决策没生效 · round_cancelled 平台取消了这局
roundClosedbool
true: no further transactions for this round after this one.true = 这笔之后该局不再有任何交易。
Response data: merchantTxnId (required on OK), balance.
响应 data:merchantTxnId(OK 时必填)、balance。
Situation on your side商户侧的情况
Answer返回
Money资金
Referenced debit succeeded and is not yet reversed被冲正的扣款成功过、还没冲正过
OK
Return amount to the player退回 amount
Same rollback txnId repeated同一笔冲正重发
Original result第一次的结果
No change不动
Referenced debit never received被冲正的扣款从没收到过
TXN_NOT_FOUND — and remember that refTxnId is rolled back, so the debit is refused with TXN_ROLLED_BACK if it arrives laterTXN_NOT_FOUND,并记下这个 refTxnId 已被冲正;那笔扣款之后到达时返回 TXN_ROLLED_BACK
Amount differs from the debit, or the debit belongs to another player / round金额与扣款不同,或扣款属于别的玩家 / 局
TXN_CONFLICT
No change不动
Round already closed钱包局已关
ROUND_CLOSED
No change不动
We treat both OK and TXN_NOT_FOUND as "rollback complete". TXN_CONFLICT / ROUND_CLOSED are flagged for manual attention and alerted, and retries continue. Anything uncertain is retried (Retries).
OK 和 TXN_NOT_FOUND 平台都视为「冲正完成」。TXN_CONFLICT / ROUND_CLOSED 标「需人工关注」并告警,重试照常继续。结果不确定的一律重试(重试)。
In addition to the common codes listed in另可能返回通用结果码,见Result codes结果码.
Test cases测试用例
The conformance test sends the following 5 requests to /rollback. Each response must match the expected result exactly.接口对接测试会向 /rollback 发送以下 5 个请求,每个响应都必须与期望结果完全一致。All test cases全部测试用例
ROL-03blocking阻断级Rollback of a debit never received未收到扣款的冲正Expected期望TXN_NOT_FOUND
/rollback R10 ref Tx (never sent) A debit_uncertain
ROL-06blocking阻断级Rollback with the correct amount金额正确的冲正Expected期望OK
/rollback R11 new T ref Tb 2A roundClosed
ROL-08blocking阻断级Rollback after round closure关局后的冲正Expected期望ROUND_CLOSED
/rollback R4 ref MUL-01's debit
ROL-09blocking阻断级Rollback of a failed debit失败扣款的冲正Expected期望TXN_NOT_FOUND
/rollback R2 ref T3 (DEB-05)
ROL-10warning警告级Rollback referencing another round's debit跨钱包局的冲正Expected期望TXN_CONFLICTor或ROUND_CLOSED