为了模拟失败场景和特定的错误码返回,可以通过设置不同的支付金额来实现。
以下为部分规则(更多信息请参考:https://www.checkout.com/docs/testing/response-code-testing)
Amount | Response code | Description |
---|---|---|
xxx05 | 20005 | Declined - Do not honour(发卡行拒绝) |
xxx12 | 20012 | Invalid payment(支付无效) |
xxx14 | 20014 | Invalid card number(卡号无效) |
xxx51 | 20051 | Insufficient funds(余额不足) |
xxx54 | 20087 | Bad track data(卡信息错误) |
xxx62 | 20062 | Restricted card(卡受限制) |
9998 | 20068 | Response received too late / timeout(超时异常) |
xxx150 仅使用3DS支付 |
20150 | 卡不支持3DS |
6900 仅使用3DS支付 |
无法确认卡是否支持3DS | |
5000 - 5029 | 20153 | 3DS系统异常,用于3DS1的测试卡 |
6510 | 20154 | 发起了一笔非3DS的支付请求,但是发卡行要求进行3DS验证 |
xxx33 | 30033 | Expired card - Pick up(过期卡) |
4001 | 40101 | Payment blocked due to risk(风控拦截) |
例如为了模拟返回码20005,则只需要amount是05结尾:
"amount": 105,
关于返回码的解释可以参考《常见问题-FAQ 如何理解Checkout.com的返回码信息?》