Question:
The request returns TRADE_STATUS_ERROR.
Cause:
The transaction status is illegal. The current transaction status does not allow this operation to be performed.
Common cases are:
- The transaction is in a pending state (WAIT_BUYER_PAY), the refund interface is called, but only a successful transaction can execute the refund interface.
- The cancel interface is called the day after the transaction.
- The refund interface is called, but the refund period of the transaction is expired.
- The initiation time of transaction is not within ["order_gmt_create"+"order_valid_time" - 60s]
Solution:
- Wait for the transaction to succeed before executing the refund interface.
- Cancel interface cannot be called the day after the transaction. Use refund interface instead.
- The in-store payment refund period is generally 365 days, after which refund is unavailable.
- The initiation time of transaction should be within ["order_gmt_create"+"order_valid_time" - 60s]
问题
执行当面付退款/撤销接口时收到报错TRADE_STATUS_ERROR。
原因
交易状态不合法,当前的交易状态不允许执行该操作。
常见案例有:
- 该笔交易处于待支付状态(WAIT_BUYER_PAY)时,调用了退款(refund)接口,只有交易成功的交易才能执行退款接口。
- 隔日交易调用当面付撤销(cancel)接口。
- 调用当面付退款(refund)接口,但交易已经超过退款期限。
- 商户发起交易时间参数值未控制在order_gmt_create+order_valid_time - 60s 之内
解决方案
- 等待交易成功后再执行退款接口。
- 隔日交易无法调用撤销接口,建议使用退款接口。
- 当面付退款期限一般多为365天,超过期限无法退款。
- 商户发起交易的时间参数值需控制在order_gmt_create+order_valid_time(秒) - 60s 之内