﻿# 交易状态/错误码

## 1. 交易状态

当PayerMax受理您的下单请求后，通过查询API或通知均可感知到付款状态。您可以通过获取交易状态，从而制定业务流程。状态如下：

| 状态    | 描述       | 备注                     |
| ------- | ---------- | ------------------------ |
| SUCCESS | 交易成功   | 用户支付成功             |
| PENDING | 交易处理中 | 等待用户完成支付         |
| FAILED  | 交易失败   | 支付失败                 |
| CLOSED  | 交易关单   | 用户在有效期内未完成支付 |

>**当订单未成功时，PayerMax会提供错误码，以便您分析失败原因。**

## 2. 错误码

PayerMax对外API提供了稳定的服务，若出现异常则会在http接口响应的body中告知您错误信息，例如：

```json
{
	"msg": "The amount doesn't match the payment method requirement.",
	"code": "AMOUNT_LIMIT"
}
```

同样，在异步的回调中，也会响应失败信息，例如：

```json
{
	"msg": "Payment was not completed on time.",
	"code": "PAYMENT_FAILED",
	"data": {
		"reference": "JOLLY",
		"country": "TH",
		"totalAmount": 300,
		"outTradeNo": "TP002024051309261650130939",
		"currency": "THB",
		"tradeToken": "T2024051309124735760727",
		"paymentDetails": [],
		"status": "CLOSED"
	},
	"keyVersion": "1",
	"appId": "5a48dcf440074021b87d4ef901bf9629",
	"merchantNo": "SP18440851",
	"notifyTime": "2024-05-13T10:28:03.606Z",
	"notifyType": "PAYMENT"
}
```
>**若正常受理，返回code是“APPLY_SUCCESS”。**

### 2.1 错误码列表

| 分类         | 结果码                          | 结果描述                                                                                                                                                                                                     | 备注                                                                                                                                      |
| ------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
|              | SYSTEM_ERROR                    | System is busy, please try again later.                                                                                                                                                                      | 系统错误；请联系PayerMax                                                                                                                  |
| 系统异常     | REQUEST_TIMEOUT                 | Request timeout or didn't get result, If you have finished to pay, pls wait for the result.                                                                                                                  | 请求超时；请联系PayerMax                                                                                                                  |
|              | UNEXPECTED_ERROR                | No further information for the error, plz try it later.                                                                                                                                                      | 未知错误；请联系PayerMax                                                                                                                  |
|              | SIGN_VERIFY_FAILED              | The signature verify failed.                                                                                                                                                                                 | 签名错误；请核实签名                                                                                                                      |
|              | MERCHANT_INVALID                | The merchant has been offline.                                                                                                                                                                               | 无效商户                                                                                                                                  |
| 基础校验异常 | MERCHANT_APP_INVALID            | Signature key is not configured.                                                                                                                                                                             | 无效商户APP                                                                                                                               |
|              | PARAMS_INVALID                  | ${field} length must be between ${min} and ${max},but your input value length is ${length}.Make sure all requests length is correct.                                                                         | 无效参数-入参字段长度不符合要求；请参考官网字段描述                                                                                       |
|              | PARAMS_INVALID                  | ${field} must be ${type} , but your input is ${valueType}.Make sure all requests type is correct.                                                                                                            | 无效参数-入参字段类型不正确；请参考官网字段描述                                                                                           |
|              | PARAMS_INVALID                  | ${field} is invalid,because ${field} is null.                                                                                                                                                                | 无效参数-入参字段不能为空；请参考官网字段描述                                                                                             |
|              | AMOUNT_INVALID                  | Amount is incorrect.                                                                                                                                                                                         | 无效的金额                                                                                                                                |
|              | COUNTRY_INVALID                 | No country support, pls re-pay.                                                                                                                                                                              | 无效的国家；可参考[支持的国家和币种](https://docs.payermax.com/202606-version/appendix/collection/supported-country-region-currency.md) |
|              | CURRENCY_INVALID                | currency is invalid,because currency is not defined.                                                                                                                                                         | 无效的币种；可参考[支持的国家和币种](https://docs.payermax.com/202606-version/appendix/collection/supported-country-region-currency.md) |
|              | CONTRACT_INVALID                | Merchant has no activated contract, please check the contract status.                                                                                                                                        | 无效合约；请检查合约有效性                                                                                                                |
|              | CONTRACT_INVALID                | Merchant has not signed the contract in ${value}.                                                                                                                                                            | 指定的国家/地区未签约；请检查合约有效性                                                                                                   |
|              | CONTRACT_INVALID                | Merchant has not signed the ${paymentMethod} payment method.                                                                                                                                                 | 指定的支付方式未签约；请检查合约有效性                                                                                                    |
|              | CONTRACT_INVALID                | Merchant has not signed the ${targetOrg} target origination correspondingly, although you have signed the ${paymentMethod} payment method.                                                                   | 指定的目标机构未签约；请检查合约有效性                                                                                                    |
|              | CONTRACT_INVALID                | Merchant has not signed the ${currency} currency correspondingly, although you have signed the ${paymentMethod} payment method.                                                                              | 指定的支付方式有签约，但所指定的币种未签约；请检查合约有效性                                                                              |
|              | CONTRACT_INVALID                | Merchant has not signed the ${currency} currency correspondingly, although you have signed the ${paymentMethod} payment method and the ${targetOrg} target origination.                                      | 指定的目标机构有签约，但所指定的币种未签约；请检查合约有效性                                                                              |
|              | PAYMENT_METHOD_NOT_EXIST        | The payment method does not exist.                                                                                                                                                                           | 支付方式不存在；请更换其他支付方式                                                                                                        |
|              | PAYMENT_METHOD_SUSPEND          | The payment method already suspend, plz try other payment methods.                                                                                                                                           | 支付方式暂不可用；请更换其他支付方式                                                                                                      |
|              | AMOUNT_LIMIT_MINIMUM            | The order amount is lower than the minimum limit of the payment method.                                                                                                                                      | 最小金额限制                                                                                                                              |
|              | AMOUNT_LIMIT_MAXIMUM            | The order amount exceeds the maximum limit of the payment method.                                                                                                                                            | 最大金额限制                                                                                                                              |
|              | AMOUNT_LIMIT                    | The amount doesn't match the payment method requirement.                                                                                                                                                     | 金额限制                                                                                                                                  |
|              | ORDER_REPEAT                    | The order number repeat.                                                                                                                                                                                     | 订单重复                                                                                                                                  |
|              | ONBOARD_ERROR                   | Please complete the merchant onboarding, then refresh the page.                                                                                                                                              | 商户未报备；请先完成报备                                                                                                                  |
|              | PAYMENT_PROCESSING              | The payment is processing, pls check the result.                                                                                                                                                             | 支付处理中；请稍后重试                                                                                                                    |
|              | PARTICIPANT_INVALID             | Invalid participant.                                                                                                                                                                                         | 无效分账参与方                                                                                                                            |
|              | ORDER_CLOSED                    | This order has been closed.                                                                                                                                                                                  | 订单关闭                                                                                                                                  |
|              | BALANCE_INSUFFICIENT            | Insufficient balance to pay, please confirm payment account available balance.                                                                                                                               | 余额不足                                                                                                                                  |
|              | OTP_VERIFY_LIMIT                | OTP verification exceeds limit.                                                                                                                                                                              | OTP验证超过限制                                                                                                                           |
|              | OTP_VERIFY_FAILED               | OTP verification failed.                                                                                                                                                                                     | OTP验证失败                                                                                                                               |
|              | OVER_VERIFY_LIMIT               | Exceeded the number of verifications.                                                                                                                                                                        | 超过验证次数                                                                                                                              |
|              | BARCODE_REFRESH_LIMIT           | Over barcode refresh times.                                                                                                                                                                                  | Barcode刷新限制                                                                                                                           |
|              | BARCODE_REFRESH_FAILED          | Barcode refresh failed.                                                                                                                                                                                      | Barcode刷新失败                                                                                                                           |
|              | CARD_INVALID                    | Make sure the card number is correct.                                                                                                                                                                        | 无效卡号                                                                                                                                  |
|              | CARD_EXPIRE_DATE_INVALID        | Invalid card number validity period                                                                                                                                                                          | 无效卡号有效期                                                                                                                            |
|              | CARD_HOLDER_NAME_INVALID        | Invalid cardholder name                                                                                                                                                                                      | 无效持卡人姓名                                                                                                                            |
|              | CVV_INVALID                     | Cvv is incorrect, pls check.                                                                                                                                                                                 | 无效CVV                                                                                                                                   |
|              | UNSUPPORT_CARD                  | This card don't support, please change another card.                                                                                                                                                         | 卡不支持                                                                                                                                  |
|              | ACCOUNT_INVALID                 | Your account is invalid or not active, please confirm and re-enter.                                                                                                                                          | 无效账号                                                                                                                                  |
|              | PHONE_NUM_INVALID               | The phone number is invalid, pls check and re-enter.                                                                                                                                                         | 无效的电话号码                                                                                                                            |
|              | UPI_INVALID                     | UPI is incorrect.                                                                                                                                                                                            | 无效UPI                                                                                                                                   |
|              | PIN_VERIFY_LIMIT                | Pin verification exceeds limit                                                                                                                                                                               | Pin验证超过限制                                                                                                                           |
|              | PIN_INVALID                     | Pin is invalid                                                                                                                                                                                               | Pin无效                                                                                                                                   |
| 业务校验异常 | BANKCODE_INVALID                | Invalid bank card number.                                                                                                                                                                                    | 无效银行卡号                                                                                                                              |
|              | ID_NUM_INVALID                  | Invalid ID number                                                                                                                                                                                            | 无效的证件号                                                                                                                              |
|              | EMAIL_INVALID                   | Your email is invalid, or your account is not active, please confirm and re-enter.                                                                                                                           | 无效的Email                                                                                                                               |
|              | DOCUMENT_INVALID                | Invalid document.                                                                                                                                                                                            | 无效的文档                                                                                                                                |
|              | TCK_INVALID                     | TC Kimlik No. is incorrect.                                                                                                                                                                                  | 无效的TC Kimlik No.                                                                                                                       |
|              | DATE_INVALID                    | The data format is error, please check.                                                                                                                                                                      | 无效的日期                                                                                                                                |
|              | PAYEE_NAME_INVALID              | Your name is invalid, or does not match, please confirm and re-enter.                                                                                                                                        | 无效的付款人姓名                                                                                                                          |
|              | REMARK_INVALID                  | Invalid remark                                                                                                                                                                                               | 无效的remark                                                                                                                              |
|              | CNIC_INVALID                    | The CNIC is incorrect, pls confirm and re-enter.                                                                                                                                                             | 无效的CNIC                                                                                                                                |
|              | ACCOUNT_BLOCKED                 | Payer account/card blocked or frozen. Pls confirm payment account/card status.                                                                                                                               | 账号被锁定/冻结                                                                                                                           |
|              | PAYMENT_CANCELED                | payment canceled.                                                                                                                                                                                            | 用户在第三方支付取消                                                                                                                      |
|              | PAYMENT_TOKEN_ID_INVALID        | PaymentTokenID is invalid. Please confirm if it has been authorized and bound                                                                                                                                | paymentTokenId不合法，请检查输入是否正确，或已经解绑                                                                                      |
|              | MER_CONFIG_ERROR                | Merchant config error.  Please contact us to check your dynamic3DS configuration.                                                                                                                            | 商户未开通动态3d功能                                                                                                                      |
|              | AUTH_NOT_SUPPORT                | The contract does not enable the Auth-Capture.                                                                                                                                                               | 合约未开通Auth-capture功能                                                                                                                |
|              | PRE_AUTH_NOT_SUPPORT            | The merchant does not support the PRE_AUTH.                                                                                                                                                                  | 商户未开通PRE_AUTH功能                                                                                                                    |
|              | RDR_REFUNDED_NOT_SUPPORT_RETRY  | This transaction has been triggered by RDR. A refund has already been successfully processed by the issuing bank. Merchants are not allowed to initiate any additional refund requests for this transaction. | 订单已经发起RDR,不能再发起退款。                                                                                                          |
|              | ORDER_CLOSE_FAILED              | order already success or failed, cannot be closed                                                                                                                                                            | 关闭订单失败，订单已经成功或失败，请检查订单状态。                                                                                        |
|              | ACCOUNT_VALIDATION_INVALID      | Please complete the account verification firstly.                                                                                                                                                            | 账户未完成验证，请先完成账户验证                                                                                                          |
|              | PAYMENT_PROCESSING_BANKTRANSFER | The previous payment is still processing, please make sure that you have made the bank transfer. Otherwise, please wait for 10 minutes to initiate a new request.                                            | 上一笔支付处理中，请确认已完成银行转账，否则请等待10分钟后重试                                                                            |
|              | REQUEST_PARAM_INVALID           | [amount.value] must be greater than zero                                                                                                                                                                     | 请求参数无效，金额必须大于零                                                                                                              |
|              | INSUF_BAL_FALLBACK              | Your account balance is insufficient to cover the amount. Please check your account balance.                                                                                                                 | 账户余额不足，请检查账户余额                                                                                                              |
|              | ONLY_ONE_AUTH_CHANNEL_ALLOWED   | only one authorization channel is allowed                                                                                                                                                                    | 仅允许一个授权渠道                                                                                                                        |
|              | ISSUER_PAYMENT_REJECTED         | Transaction failed at issuer end due to risk control. Please try using a different card or contact your issuer for more detail.                                                                              | 交易被发卡行风控拒绝，请更换银行卡或联系发卡行                                                                                            |
|              | AMOUNT_LIMIT                    | The amount exceeds user amount limit.                                                                                                                                                                        | 用户金额限制                                                                                                                              |
|              | AMOUNT_LIMIT                    | The amount exceeds the limit for per transaction limit.                                                                                                                                                      | 单笔交易金额限制                                                                                                                          |
|              | AMOUNT_LIMIT                    | The amount exceeds the limit for the day.                                                                                                                                                                    | 日交易金额限制                                                                                                                            |
|              | CARD_INVALID                    | Expired card.                                                                                                                                                                                                | 卡已过期                                                                                                                                  |
|              | CARD_INVALID                    | Card scheme is not supported.                                                                                                                                                                                | 卡组织不支持                                                                                                                              |
|              | CARD_INVALID                    | Only support the card which issue by local bank, pls change local card.                                                                                                                                      | 仅支持本地银行卡                                                                                                                          |
|              | OTP_VERIFY_FAILED               | OTP verify failed.                                                                                                                                                                                           | OTP验证失败                                                                                                                               |
|              | PAYMENT_METHOD_NOT_EXIST        | Bank temporarily not available, please retry later.                                                                                                                                                          | 银行暂时不可用，请稍后重试                                                                                                                |
|              | PAYMENT_METHOD_SUSPEND          | The payment method is in maintenance, please try again later.                                                                                                                                                | 支付方式维护中，请稍后重试                                                                                                                |
|              | PAYMENT_FAILED                  | Transaction declined.                                                                                                                                                                                        | 交易被拒绝                                                                                                                                |
|              | PAYMENT_FAILED                  | There is no channel to support the payment.                                                                                                                                                                  | 无可用支付渠道                                                                                                                            |
|              | PAYMENT_FAILED                  | Payment was not completed on time.                                                                                                                                                                           | 支付超时未完成                                                                                                                            |
|              | PAYMENT_FAILED                  | Provider failed to process.                                                                                                                                                                                  | 支付失败                                                                                                                                  |
|              | AUTHENTICATE_FAILED             | Your payment was declined due to authentication failure. Please try using a different card or contact your issuer for more detail.                                                                           | 授权失败                                                                                                                                  |
| 授权异常     | AUTH_EXPIRED                    | The authorization has expired, pls rebind.                                                                                                                                                                   | 授权过期                                                                                                                                  |
|              | AUTH_FAILED                     | Authorization failed.                                                                                                                                                                                        | 授权失败或不存在                                                                                                                          |
|              | RISK_FAILED                     | This transaction was automatically blocked due to identified risk.                                                                                                                                           | 该交易因存在确认性风险被拦截                                                                                                              |
|              | RISK_FAILED                     | The payment has reached the security limit. Please advise the user to try another payment method or attempt the transaction again later.                                                                     | 用户支付已达到安全限额/限次，建议用户尝试其他支付方式                                                                                     |
| 交易拒绝     | RISK_FAILED                     | The payment has exhibited suspicious activity. We suggest that the user use a local card or disable their VPN before trying again.                                                                           | 检测到支付行为异常，建议用户使用本地银行卡或关闭VPN后重试                                                                                 |
|              | RISK_FAILED                     | The payment was declined due to unusual activity from the user. We recommend changing to a different payment method and attempting the transaction again.                                                    | 由于交易风险较高，支付已被拒绝，建议用户更换其他支付方式                                                                                  |
|              | ISSUER_PAYMENT_REJECTED         | Device IP restriction,please make sure your VPN is turned off when making the payment for security reason.                                                                                                   | 设备IP受限，请关闭VPN后重试                                                                                                               |
|              | PAYMENT_REJECTED                | Transaction failed at processor end due to risk control.Please try using a different payment method/card.                                                                                                    |                                                                                                                                           |
| 商户拒绝     | RISK_BLACK_LIST_FAILED          | The payment was declined due to high risk with the payment.                                                                                                                                                  | 此笔交易命中商户自身侧黑名单，黑名单详情可登录MMC查询                                                                                     |
| 发卡行拒绝   | ISSUER_PAYMENT_REJECTED         | Transaction failed at issuer end due to risk control. Please contact your payment method issuer for more detail.                                                                                             | 交易被发卡行拒绝，详情请用户咨询发卡行确认                                                                                                |
| 查询         | ORDER_NOT_EXIST                 | The order does not exist.                                                                                                                                                                                    | 订单不存在                                                                                                                                |
|              | REFUND_FAILED                   | The payment method does not support partial refund.                                                                                                                                                          | 退款失败-支付方式不支持部分退款                                                                                                           |
|              | REFUND_FAILED                   | The payment method does not support refund.                                                                                                                                                                  | 退款失败-支付方式不支持退款                                                                                                               |
| 退款         | REFUND_FAILED                   | The refund amount is too small to refund.                                                                                                                                                                    | 退款失败-退款金额太小                                                                                                                     |
|              | REFUND_NO_INVALID               | RefundNo shouldn't same with TradeNo.                                                                                                                                                                        | 退款单号无效                                                                                                                              |
|              | REFUND_INSUFFICIENT_BALANCE     | Insufficient Txn currency in the to be Settled Account.                                                                                                                                                      | 余额不足无法退款                                                                                                                          |
|              | ORDER_NOT_EXIST                 | The orginal order does not exist.                                                                                                                                                                            | 退款单不存在                                                                                                                              |
