# SDK return codes

> This part will introduce you the event codes, card payment information, and risk control details that may be returned via callback functions or other methods.

 During the integration of the Antom SDK, this part will introduce you the event codes, card payment information, and risk control details that may be returned via callback functions or other methods.

## `onEventCallback`       callback function event codes {#6co9k}

 Event codes are returned through different callback functions at different times, mainly including the following three types:

 - Status codes
- Error codes
- Payment result codes

### Status codes {#Qk1Pt}

 Returned through the   `onEventCallback`   method during the component's runtime lifecycle, and subsequent processing can be done based on the specific event.

 - `SDK_START_OF_LOADING`  : The loading animation starts to be shown when the component is created. When configured to hide loading and use a custom animation, the custom animation can be rendered at this time.
- `SDK_END_OF_LOADING`  : The loading animation ends when the component is created. When configured to hide loading and use custom animation, the animation can be hidden at this time.
- `SDK_PAYMENT_CANCEL`  : Indicates that the user canceled the payment (the user exited the payment page without submitting the order). You can re-invoke the SDK using the paymentSessionData within its validity period. If it has expired, you need to initiate a new     **createPaymentSession**     request.
- `SDK_CALL_URL_ERROR`  : This event code represents one of the following situations in the event information:

   - Failed to redirect to merchant page.
  - Failed to redirect to the payment method app or page.
  - The     *paymentRedirectUrl*     parameter is not specified or is not correctly specified when calling the     **createPaymentSession**     request.

 In the Web or WAP scenario, redirecting links is usually not abnormal. If an exception does occur, it is recommended that you verify the redirected link. In the app scenario, if the exception frequently occurs, contact Antom Technical Support to troubleshoot redirection or calling issues.

 - `SDK_CALL_URL_SUCCESS`  : Successfully redirected to the payment method/merchant page.
- `SDK_DUPLICATE_SUBMISSION_BEHAVIOR`  : The form is submitted repeatedly. The merchant can prompt the user through a toast without the need to click submit repeatedly.
- `SDK_FORM_VERIFICATION_FAILED`  : The form verification failed after submitting the form. The SDK will display the form error code on the element collection page, allowing users to resubmit payments.
- `SDK_PAYMENT_AUTHORIZATION_SUCCESSFUL`  : The payment process is completed. If the method of not redirecting after payment is configured, it is recommended to continue listening for the corresponding payment event code to handle the subsequent process. This event code, otherwise, can be ignored and redirected to your payment results page.
- `SDK_PAYMENT_CHALLENGE`  : Triggering a 3D challenge, and the issuing bank needs further interaction with shoppers before payment can be verified. No need to process, the SDK will redirect to the challenge page.

### Error codes {#zjamm}

 Returned through the   `onEventCallback`   or   `onError`   method during the component initialization phase, and subsequent processing can be done based on the specific event.

 - `SDK_INTERNAL_ERROR`  : SDK internal error. Contact Antom Technical Support.
- `SDK_CREATEPAYMENT_PARAMETER_ERROR`  :   `createComponent`   method specified parameter abnormally. Check if the parameters are correct and reinitialize the component.
- `SDK_INIT_PARAMETER_ERROR`  :   `AMSCashierPayment`   method specified parameter abnormally. Check if the parameters are correct and re-instantiate the SDK.
- `SDK_CREATECOMPONENT_ERROR`  : Component initialization exception. Contact Antom Technical Support.
- `SDK_SUBMIT_NETWORK_ERROR`  : API call failed due to network reasons. It may occur in   `submit`   method submission. Try to submit it again.

### Payment result codes {#Gt8Qv}

 Returned through the   `onEventCallback`   method at the end of the payment process and subsequent processing can be done based on the specific event.

 - `SDK_PAYMENT_SUCCESSFUL`  : Payment is successful. The buyer needs to cancel the SDK for the first-time payment, and the SDK will close in the card token payment mode. Suggest redirecting to the payment result page.
- `SDK_PAYMENT_FAIL`  : Payment failed. We suggest that you follow the     *paymentResultCode*     error code prompt and guide the user to pay again.
- `SDK_PAYMENT_PROCESSING`  : Payment is being processed. It is recommended to check the payment status on your server or wait for the payment result notification.
- `SDK_PAYMENT_ERROR`  : The payment status is abnormal. It is recommended to check the payment status on your server or wait for the payment result notification.
- `SDK_PAYMENT_RETRY`  : Retry after payment failure. When you enable the option to retry after payment failure, guide the buyer to modify the information and pay again.

#### Description of payment failure or abnormal payment status {#nuduf}

 The following table provides payment result code and corresponding handling suggestions for payment failure or abnormal payment status. You can take further action based on the received payment result code.

 | **paymentResultcode** | **paymentResultMessage** | **Suggestion** |
| --- | --- | --- |
| ACCESS_DENIED | Access is denied. | Insufficient permissions. Contact Antom Technical Support for specific reasons. |
| CURRENCY_NOT_SUPPORT | The currency is not supported. | Currency is not supported. Contact Antom Technical Support for specific reasons. |
| FRAUD_REJECT | The transaction cannot be further processed because of risk control. If the user has already paid for the transaction, the transaction will be refunded. | Fraud denied. Contact Antom Technical Support if: - You need to appeal. - The buyer did not receive a refund within two weeks. |
| INVALID_CARD | The card is invalid. Maybe the credit card number cannot be identified, the card has no corresponding issuing bank, or the card number is in the wrong format. | Change the card and try again. |
| INVALID_EXPIRY_DATE_FORMAT | The format of     *expiryYear*     or     *expiryMonth*     is wrong. | The card's expiration date is incorrect. Check the format of filling in the card validity period. |
| ISSUER_REJECTS_TRANSACTION | The issuing bank rejects the transaction. | The issuing bank refused. Change the card and try again or contact the issuing bank. |
| INVALID_MERCHANT_STATUS | The merchant status is abnormal because restrictions exist. | Merchant status is abnormal. Contact Antom Technical Support for specific reasons. |
| MERCHANT_KYB_NOT_QUALIFIED | The payment failed to your abnormal KYB status. You are either not KYB compliant, or the KYB status is not qualified for this transaction. | Contact Antom Technical Support for specific reasons. |
| NO_PAY_OPTIONS | The currency is not supported for the transaction. | Currency is not supported. Check if the payment method supports the currency or if the payment method and currency are consistent with the contract. If there are any issues, contact Antom Technical Support for specific reasons. |
| ORDER_IS_CLOSED | The request you initiated has the same paymentRequestId as that of the existing transaction, which is closed. | The order has been closed. Initiate a new request and retry. |
| PAYMENT_AMOUNT_EXCEED_LIMIT | The payment amount is greater than the maximum amount allowed by the contract or payment method. | Limit amount exceeded. Check whether the payment amount exceeds the limit or try again with a lower amount. Contact Antom Technical Support for specific payment limits. |
| PAYMENT_COUNT_EXCEED_LIMIT | The maximum number of payments exceeds the limit specified by the payment method. | Use limit exceeded. Contact Antom Technical Support for specific payment limits. |
| PAYMENT_NOT_QUALIFIED | The merchant is not qualified to pay because the merchant is not registered, does not have a contract for Tokenized Payment, or is forbidden to make a payment. | The merchant does not have permission. Contact Antom Technical Support for specific reasons. |
| PROCESS_FAIL | A general business failure occurred. | Payment failed. This usually requires manual confirmation of the issue. Contact Antom Technical Support to resolve the issue. |
| RISK_REJECT | The transaction cannot be further processed because of risk control. If the user has already paid for the transaction, the transaction will be refunded. | Risk control refused. If the buyer does not receive a refund within two weeks, contact Antom Technical Support. |
| SUSPECTED_CARD | The card is suspected of fraud. For example, the card is stolen or restricted. | Risk control refused. Change the card and try again or contact the issuing bank. |
| SUSPECTED_RISK | The transaction cannot be further processed because of suspected security issues. You can retry the transaction after one working day. If the transaction is not secure and the user has already paid, the transaction will be refunded. | Risk control refused. Contact Antom Technical Support if: - You need to appeal. - The buyer did not receive a refund within two weeks. |
| USER_AMOUNT_EXCEED_LIMIT | The payment amount exceeds the buyer payment limit. | The amount exceeds the limit. Reinitiate the payment with an amount less than or equal to the available balance in your account, or contact Antom Technical Support. |
| USER_BALANCE_NOT_ENOUGH | The payment cannot be completed because the user balance in the corresponding payment method is not enough. | Insufficient user balance. Recharge or choose another payment method. |
| USER_KYC_NOT_QUALIFIED | The payment failed because of the user's KYC status. The user is either not KYC compliant, or the KYC status is not qualified for this transaction (for example, limitations on the payment amount or product information). | The user completes KYC authentication first. |
| USER_PAYMENT_VERIFICATION_FAILED | The user is restricted from payment on the payment method side. | The user did not complete verification. Contact Antom Technical Support for specific reasons. |
| USER_STATUS_ABNORMAL | The user status is abnormal on the payment method side. | The user status is abnormal. Contact Antom Technical Support for specific reasons. |
| PAYMENT_IN_PROCESS | The payment is being processed. | Payment is being processed. |
| UNKNOWN_EXCEPTION | Due to unknown reasons, the API call failed. | Unknown exception. Contact Antom Technical Support for specific reasons. |
| CARD_NOT_SUPPORTED | The card used for the transaction is not supported. | The card is not supported. Change the card and try again. |
| INVALID_EXPIRATION_DATE | The value of     *paymentMethod.paymentMethodMetaData.expiryYear*     or     *paymentMethod.paymentMethodMetaData.expiryDate*     is invalid. | The validity period of the card is incorrect. Check if the validity period of the card is filled out correctly. |
| INVALID_CARD_NUMBER | The number of the card used for the transaction is invalid. | The card number is incorrect. Change the card and try again. If there are still problems after trying again, contact Antom Technical Support for specific reasons. |

## `mount().then()`  callback function event codes {#M3TUS}

 During the component’s lifecycle, the  `mount().then()`  callback function may return the following error codes and corresponding status codes. You can handle subsequent actions based on specific events.

 | ***code*** | ***status*** | **Suggested prompt for buyers (*message*)** | **Description** | **Recommended action** |
| --- | --- | --- | --- | --- |
| UNKNOWN_EXCEPTION | `PROCESSING` | 未知异常。请检查付款情况并联系商户。 | Due to unknown reasons, the API call failed. | If the rendering still fails after the front end retries, please contact Antom technical support. |
| INQUIRY_PAYMENT_SESSION_FAILED | `FAIL` | 订单状态异常。请检查付款情况并联系商户。 | The payment session has expired. | The order has timed out and been closed. Please use a new     *paymentRequestId*     to initiate the payment again. |
| UI_STATE_ERROR | `FAIL` | 请求异常，交易无法发起。 | The timing of the `mount()` method call is abnormal. | Integration code exception. Please troubleshoot. If the problem persists, contact Antom technical support. |
| ERR_DATA_STRUCT_UNRECOGNIZED | None | 请求异常，交易无法发起。 | The SDK    did not return the required payment information. | If the rendering still fails after the front end retries, please contact Antom technical support for details. |
| PARAM_INVALID | None | 请求异常，交易无法发起。 | SDK input parameters are abnormal. | Integration code exception. Please troubleshoot. If the problem persists, contact Antom technical support. |
| INITIALIZE_API_TIMEOUT | None | 请求异常，交易无法发起。 | The SDK had timed out, causing the checkout page rendering to fail. | Buyer network exception or Antom service exception detected. Please retry the   `mount()`   method. |
| INITIALIZE_WEB_TIMEOUT | None | 请求异常，交易无法发起。 | The checkout page static resource loading had timed out. | Buyer network exception or Antom service exception detected. Please retry the   `mount()`   method. |

## `submitPayment().then()`  callback function event codes {#heMi7}

 During the component's lifecycle, the   `submitPayment().then()`      callback function may return the following error codes and corresponding status codes. You can handle subsequent actions based on specific events.

 | ***code*** | ***status*** | **Suggested prompt for buyers (*message*)** | **Description** | **Recommended action** |
| --- | --- | --- | --- | --- |
| UNKNOWN_EXCEPTION | `PROCESSING` | 未知异常。请检查付款情况并联系商户。 | Due to unknown reasons, the API call failed. | It is recommended to poll the payment result from the server. If no payment result is found, you can re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| INQUIRY_PAYMENT_SESSION_FAILED | `FAIL` | 订单状态异常。请检查付款情况并联系商户。 | The payment session has expired. | The order has timed out and been closed. Please use a new     *paymentRequestId*     to initiate the payment again. |
| UI_STATE_ERROR | `FAIL` | 请求异常，交易无法发起。 | The timing of the `mount()` method call is abnormal. | Integration code exception. Please troubleshoot. If the problem persists, contact Antom technical support. |
| ERR_DATA_STRUCT_UNRECOGNIZED | None | 请求异常，交易无法发起。 | The SDK    did not return the required payment information. | Please contact Antom technical support for details. |
| USER_BALANCE_NOT_ENOUGH | `FAIL` | 用户余额不足。请充值或选择其它支付方式。 | Payment failed due to insufficient buyer balance for the selected payment method. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| ORDER_NOT_EXIST | `FAIL` | 订单状态异常。请检查付款情况并联系商户。 | The order does not exist. | Please contact Antom technical support for details. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| PROCESS_FAIL | `FAIL` | 支付失败。请检查付款情况并联系商户。 | Common business failure occurred. | Please contact Antom technical support for details. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| ORDER_IS_CANCELLED | `FAIL` | 订单状态异常。请检查付款情况并联系商户。 | The order has been cancelled. | The order has been cancelled. To make another payment, you need to use a new *paymentRequestId* to re-initiate the payment. |
| RISK_REJECT | `FAIL` | 风控拒绝。建议换卡重试或联系发卡行。 | Due to risk control, the transaction cannot be further processed. If the buyer has made payment for the transaction, it will be refunded. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| ORDER_IS_CLOSED | `FAIL` | 订单状态异常。请检查付款情况并联系商户。 | The request you initiated uses the same     *paymentRequestId*     as a closed transaction. | The order has timed out and been closed. Please use a new     *paymentRequestId*     to initiate the payment again. |
| ACCESS_DENIED | `FAIL` | 支付失败。请检查付款情况并联系商户。 | The access is denied. | Please contact Antom technical support for details. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| CARD_EXPIRED | `FAIL` | 卡片已过期，请核对过期日期或使用其他卡片。 | The bank card used for the transaction has expired. | Antom has notified the buyer, and no further action required. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| INVALID_EXPIRY_DATE_FORMAT | `FAIL` | 卡片过期时间不正确，请核对过期日期或使用其他卡片。 | The format of     *expiryYear*     or     *expiryMonth*     is incorrect. | Antom has notified the buyer, and no further action required. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| INVALID_EXPIRATION_DATE | `FAIL` | 卡片过期时间不正确，请核对过期日期或使用其他卡片。 | The value of     *paymentMethod.paymentMethodMetaData.expiryYear*     or     *paymentMethod.paymentMethodMetaData.expiryDate*     is invalid. | Antom has notified the buyer, and no further action required. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| INVALID_CVV | `FAIL` | 卡片 CVV 不正确，请核对 CVV 或使用其他卡片。 | The bank card used for the transaction has an invalid CVV. | Antom has notified the buyer, and no further action required. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| INVALID_CARD_NUMBER | `FAIL` | 卡号不正确，建议换卡重试或联系发卡行。 | The bank card used for the transaction has an invalid card number. | Antom has notified the buyer, and no further action required. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| SELECTED_CARD_BRAND_NOT_AVAILABLE | `FAIL` | 卡品牌不支持，建议换卡重试或联系发卡行。 | The card brand you specified for transactions is not supported. | The card brand you specified for transactions is not supported. Please troubleshoot. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| CARD_NOT_SUPPORTED | `FAIL` | 卡片不支持。建议换卡重试或联系发卡行。 | The bank card used for the transaction is not supported. | Antom has notified the buyer, and no further action required. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| CARD_BIN_QUERY_ERROR | `FAIL` | 卡号不正确。建议换卡重试或联系发卡行。 | The bank card used for the transaction has an invalid card number. | Antom has notified the buyer, and no further action required. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| PAYMENT_IN_PROCESS | `PROCESSING`  / `PENDING` | 支付正在处理中，请等待支付完成。 | The payment is being processed. | `PROCESSING`   indicates that no payment result is found after the SDK inquiry. It is recommended to poll the payment result from the server, and re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. You can check the     *userCanceled3D*     field in the response to determine whether the buyer manually closed the 3D Secure pop-up: - `true`  : The buyer manually aborts the 3D Secure process. - `false`  : The 3D Secure process is not aborted by the buyer. |
| CURRENCY_NOT_SUPPORT | `FAIL` | 商户不支持该币种，交易无法发起。 | The currency is not supported. | Please contact Antom technical support for details. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| INVALID_CARD | `FAIL` | 卡号无效，请核对卡片详细信息或使用其他卡片。 | Invalid bank card. Possible reasons include: the bank card number cannot be recognized, the card has no corresponding issuing bank, or the card number format is incorrect. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| ISSUER_REJECTS_TRANSACTION | `FAIL` | 发卡行拒绝交易，建议换卡重试或联系发卡行。 | The issuing bank rejects the transaction. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| INVALID_MERCHANT_STATUS | `FAIL` | 商户状态异常，交易无法发起。 | The merchant status is abnormal because restrictions exist. | Please contact Antom technical support for details. |
| KEY_NOT_FOUND | `FAIL` | 未知异常。请检查付款情况并联系商户。 | The private key or public key of Antom or the merchant is not found. | Please contact Antom technical support for details. |
| MERCHANT_KYB_NOT_QUALIFIED | `FAIL` | 商户状态异常，交易无法发起。 | The payment failed to your abnormal KYB status. You are either not KYB compliant, or the KYB status is not qualified for this transaction. | Please contact Antom technical support for details. |
| NO_PAY_OPTIONS | `FAIL` | 没有可用的支付选项。 | No payment options are available. | Please contact Antom technical support for details. |
| PARAM_ILLEGAL | `FAIL` | 未知异常。请检查付款情况并联系商户。 | The required parameters are not passed, or illegal parameters exist. For example, a non-numeric input, an invalid date, or the length and type of the parameter are incorrect. | Please contact Antom technical support for details. |
| PAYMENT_AMOUNT_EXCEED_LIMIT | `FAIL` | 商户支付金额超过限额，交易无法发起。 | The payment amount is greater than the maximum amount allowed by the contract or payment method. | Check whether the payment amount exceeds the limit, or use a lower amount and try again. Use a new *paymentRequestId* to change the amount and re-initiate the payment. |
| PAYMENT_COUNT_EXCEED_LIMIT | `FAIL` | 商户支付次数超过限制使用次数，交易无法发起。 | The maximum number of payments exceeds the limit specified by the payment method. | Please contact Antom technical support for details. |
| PAYMENT_NOT_QUALIFIED | `FAIL` | 商户状态异常，交易无法发起。 | You are not eligible to make payments, possibly because you are not registered, have not signed the Tokenized Payment contract, or are prohibited from making payments. | Please contact Antom technical support for details. |
| SUSPECTED_CARD | `FAIL` | 风控拒绝。建议换卡重试或联系发卡行。 | The bank card is suspected of fraud. For example, it may be stolen or restricted. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| SYSTEM_ERROR | `FAIL` | 未知异常。请检查付款情况并联系商户。 | A system error occurred. | Please contact Antom technical support for details. Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| USER_AMOUNT_EXCEED_LIMIT | `FAIL` | 金额超限。使用小于或等于账户可用余额的金额重新发起支付。 | The payment amount exceeds the buyer payment limit. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| USER_KYC_NOT_QUALIFIED | `FAIL` | 用户状态异常。建议换卡重试或换支付方式重试。 | The payment failed because of the buyer's KYC status. The buyer is either not KYC compliant, or the KYC status is not qualified for this transaction (for example, limitations on the payment amount or product information). | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| USER_PAYMENT_VERIFICATION_FAILED | `FAIL` | 用户状态异常。建议换卡重试或联系发卡行。 | The buyer is restricted from making payments by the payment method provider. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| USER_STATUS_ABNORMAL | `FAIL` | 用户状态异常。建议换卡重试或联系发卡行。 | The buyer status is abnormal on the payment method side. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| DO_NOT_HONOR | `FAIL` | 支付被发卡行拒绝。建议换卡重试或联系发卡行。 | The payment is rejected by the issuing bank. | Display a pop-up message to the buyer. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| EXTERNAL_RESOURCE_LOAD_FAILED | `FAIL` | 请求异常，请检查网络状况或者设备情况。 | Google/Apple resource error. | Buyer network exception detected, or their device does not support payments via Google, Apple, or other third‑party‑dependent platforms. It is recommended to display a pop‑up prompting the buyer to check their payment execution environment. |
| SUBMIT_PAYMENT_TIMEOUT | `PROCESSING` | 请求异常，交易无法发起。 | Network exception occurred during payment submission. | Buyer network exception or Antom service exception detected. Please try to poll the payment result from the server. If the payment result cannot be retrieved, re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| PAYMENT_RESULT_TIMEOUT | `PROCESSING` | 请求异常，交易无法发起。 | Network exception occurred while retrieving the payment result. | Please try to poll the payment result from the server. If the payment result cannot be retrieved, re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| USER_CANCELED | `PROCESSING` | 无。 | The buyer closed the QR code or leading pop-up manually. | Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |
| FORM_INVALID | `FAIL` | 无。 | Incorrect payment information entered. | Antom has notified the buyer, and no further action required. Re-initiate `submitPayment()` using the existing *paymentSessionData* within the payment session validity period. |

## Create Component callback function event codes {#efco9k}

 During the component’s lifecycle, the   `onCreateComponentCallback`   or   `createComponent:completion:`   callback function may return the following error codes and corresponding status codes. You can handle subsequent actions based on specific events.

 | ***code*** | ***status*** | **Suggested prompt for buyers (*message*)** | **Description** | **Recommended action** |
| --- | --- | --- | --- | --- |
| UI_STATE_ERROR | None | 请求异常，交易无法发起。 | The timing in creating the SDK instance or calling the   `createComponent`  method is abnormal. | Integration code exception. Please troubleshoot. If the problem persists, contact Antom technical support. |
| PARAM_INVALID | None | 请求异常，交易无法发起。 | Invalid SDK input parameters. | Integration code exception. Please troubleshoot. If the problem persists, contact Antom technical support. |
| INITIALIZE_WEB_TIMEOUT | None | 请求异常，交易无法发起。 | The checkout page static resource loading had timed out. | Buyer network exception or Antom service exception detected. Please retry calling the `createComponent` method. |
| INQUIRY_PAYMENT_SESSION_FAILED | None | 订单状态异常。请检查付款情况并联系商户。 | The payment session has expired. | The order has timed out and been closed. Please use a new     *paymentRequestId*     to initiate the payment again. |

## `onSubmitPayCallback`  callback function event codes {#UOmXC}

 During the component’s lifecycle, the   `onSubmitPayCallback`   or   `onSubmitPayCallback:`   callback function may return the following error codes and corresponding status codes. You can handle subsequent actions based on specific events.

 | ***code*** | ***status*** | **Suggested prompt for buyers (*message*)** | **Description** | **Recommended action** |
| --- | --- | --- | --- | --- |
| None | `SUCCESS` | 无。 | The payment is successful. | No further action is needed. |
| PAYMENT_IN_PROCESS | `PROCESSING` | 无。 | The payment is processing. | It is recommended to poll the payment result from the server. If no payment result is found, you can re-initiate `createComponent` using the existing *paymentSessionData* within the payment session validity period. |
| None | `PROCESSING` | 无。 | The payment is processing. | It is recommended to poll the payment result from the server. If no payment result is found, you can re-initiate `createComponent` using the existing *paymentSessionData* within the payment session validity period. |
| None | `CANCELLED` | 无。 | The order has been cancelled. | None. |
| UNKNOWN_EXCEPTION | `PROCESSING` | 未知异常。请检查付款情况并联系商户。 | Due to unknown reasons, the API call failed. | Please contact Antom technical support for details. It is recommended to poll the payment result from the server. If no payment result is found, you can re-initiate `createComponent` using the existing *paymentSessionData* within the payment session validity period. |
| USER_CANCELED | `PROCESSING` | 无。 | The buyer closed the payment QR code page or the guide page. | Re-initiate `createComponent` using the existing *paymentSessionData* within the payment session validity period. |
| PAYMENT_RESULT_TIMEOUT | `PROCESSING` | 未知异常。请检查付款情况并联系商户。 | Network exception occurred while retrieving the payment result. | Please try to inquire the payment result from the server. If the payment result cannot be retrieved, re-initiate `createComponent` using the existing *paymentSessionData* within the payment session validity period. |
| ORDER_IS_CANCELLED | `FAIL` | 订单状态异常。请检查付款情况并联系商户。 | The order has been cancelled. | The order has been cancelled. Use a new *paymentRequestId* to re-initiate the payment. |
| ORDER_IS_CLOSED | `FAIL` | 订单状态异常。请检查付款情况并联系商户。 | The request you initiated uses the same     *paymentRequestId*     as a closed transaction. | The order has timed out and been closed. Please use a new     *paymentRequestId*     to initiate the payment again. |
| INQUIRY_PAYMENT_SESSION_FAILED | `FAIL` | 订单状态异常。请检查付款情况并联系商户。 | The payment session has expired. | The order has timed out and been closed. Please use a new     *paymentRequestId*     to initiate the payment again. |
| USER_CLOSE_PAYMENT | None | 无。 | The buyer closed the overlay pop-up before clicking the payment button. | Re-initiate `createComponent` using the existing *paymentSessionData* within the payment session validity period. |

## `initConfiguration:completion:`  callback function event codes {#l1qwb}

 During the component’s lifecycle, the   `initConfiguration:completion:`   callback function may return the following error codes and corresponding status codes. You can handle subsequent actions based on specific events.

 | ***code*** | ***status*** | **Description** | **Recommended action** |
| --- | --- | --- | --- |
| UI_STATE_ERROR | None | The request is abnormal and the transaction cannot be initiated. SDK instance creation exception. | Integration code exception. Please troubleshoot. If the problem persists, contact Antom technical support. |

## Card payment information {#F5SBW}

 In the case of card payment, once the payment processing reaches a final state of success or failure, you will receive the     *cardPaymentResultInfo*     parameter in the response after invoking the   `onEventCallback`   function. See the table below to explore child parameters of     *cardPaymentResultInfo*    :

 > **[INFO]** **Note**    : If the payment flow completes and the user is redirected to the redirection URL, you will not receive the     *cardPaymentResultInfo*     parameter.

 | **Parameter name** | **Required** | **Description** |
| --- | --- | --- |
| *cardNo* | Optional | String (32) The masked card number, which just shows part of the card number and can be used to display to the user. This parameter is returned when the value of        *paymentMethodType*        in the        **pay**     API is      `CARD`      and the merchant does not have the PCI qualification. |
| *cardBrand* | Optional | String (256) The card brand, which can be used to display to the user. This parameter is returned when the value of        *paymentMethodType*        in the        **pay**     API is      `CARD`      . |
| *cardBin* | Optional | String (32) The first six digits of the card number. |
| *lastFour* | Optional | String (4) The last four digits of the card number. |
| *issuerName* | Optional | String (256) The issuing bank of the card. |
| *issuingCountry* | Optional | String (2) The issuing country of the card. The value of this parameter is a 2-letter country code that follows      [ISO 3166 Country Codes](https://www.iso.org/obp/ui/#search)      standard. This parameter is returned when the value of     *paymentMethodType*     in the     **pay**     API is   `CARD`  . |
| *funding* | Optional | String (32) The funding type of the card. Valid values are: - `CREDIT`  : indicates a credit card. - `DEBIT`  : indicates a debit card. - `PREPAID`  : indicates a prepaid card. - `CHARGE`  : indicates a charge card. - `DEFERRED_DEBIT`  : indicates a deferred debit card.    *​*   > **[INFO]** This parameter is returned when all the following conditions are met: - The value of     *paymentMethodType*     is   `CARD`  . > - The value of     *cardNo*     is valid. > - The information is available in the Antom card database. |
| *avsResultRaw* | Optional | String (128) The raw AVS result. See      [AVS result codes](https://docs.antom.com/ac/apo/risk_manage.md#t5J3c)      to check the valid values. This parameter is returned when the issuing bank passes this information to Antom. |
| *cvvResultRaw* | Optional | String (128) The raw Card Verification Value (CVV), Card Security Code (CSC), or Card Verification Code (CVC) result. See      [CVV result codes](https://docs.antom.com/ac/apo/risk_manage.md#GqDgg)      to check the valid values. This parameter is returned when the issuing bank passes this information to Antom. |
| *holdName* | Optional | String (32) The card holder name. |
| *fingerprint* | Optional | String (256) The unique identifier for this specific card number. You can use this parameter to check if two registered customers are using the same card number. |
| *expiryMonth* | Optional | String (2) The month the card expires. Pass in two digits representing the month. For example, if the expiry month is February, the value of this parameter is      `02`  . > **[INFO]** This parameter is returned when all the following conditions are met: - You have the PCI qualification. > - The value of        *paymentMethodType*     is   `CARD`  . > - The information is available in the Antom card database. |
| *expiryYear* | Optional | String (2) The year the card expires. Pass in the last two digits of the year number. For example, if the expiry year is 2025, the value of this parameter is      `25`  . > **[INFO]** This parameter is returned when all the following conditions are met: - You have the PCI qualification. > - The value of        *paymentMethodType*     is   `CARD`  . > - The information is available in the Antom card database. |

 The sample code of returned card information:

 ```json
{
    "result": {
        "resultCode": "SUCCESS",
        "resultStatus": "S",
        "resultMessage": "Success"
    },
    "paymentStatus": "SUCCESS",
    "paymentResultCode": "SUCCESS",
    "paymentResultMessage": "success",
    "cardPaymentResultInfo": {
        "avsResultRaw": "4",
        "cardBin": "409280",
        "cardBrand": "VISA",
        "cardNo": "************8888",
        "cvvResultRaw": "1",
        "expiryMonth": "02",
        "expiryYear": "27",
        "fingerprint": "",
        "funding": "DEBIT",
        "holdName": "Tom Jay",
        "issuerName": "BANCO ITAUCARD, S.A.",
        "issuingCountry": "BR",
        "lastFour": "0000"
    }
}
```

## Risk control {#tkG2R}

 In the case    of card payment, once the payment processing reaches a final state of success or failure and you h   ave signed the risk control service with Antom, you will receive the     *popRiskDecisionResultInfo*          parameter in the response after invoking the   `onEventCallback`   function.    See the table below to explore child parameters of     *popRiskDecisionResultInfo*    :

 > **[INFO]** **Note**    :    If the payment flow completes and the user is redirected to the    redirection    URL, you will not receive the     *popRiskDecisionResultInfo*     parameter.

 | **Parameter name** | **Required** | **Description** |
| --- | --- | --- |
| *riskDecision* | Optional | String (16) Risk management decision from Antom. Valid values are: - `ACCEPT`  : Indicates that Antom advises to accept the payment. - `REJECT`  : Indicates that Antom advises to reject the payment.   This parameter is returned when you signed risk control service with Antom. |
| *riskAuthDecision* | Optional | String (16) The authentication method recommended by Antom. Valid values are: - `3D`  : 3D authentication is recommended for this transaction. - `NON_3D`  : Non-3D authentication is recommended for this transaction.   This parameter is returned when you signed risk control service with Antom. |

 The sample code of returned risk control information:

 ```json
{
    "result": {
        "resultCode": "SUCCESS",
        "resultStatus": "S",
        "resultMessage": "Success"
    },
    "paymentStatus": "SUCCESS",
    "paymentResultCode": "SUCCESS",
    "paymentResultMessage": "success",
    "popRiskDecisionResultInfo": {
        "riskDecision": "ACCEPT",
        "riskAuthDecision": "NON_3D"
    }
}
```