# setOnSubmitPayListener()

> This method is called by merchant applications to register a callback listener for payment or vaulting submission status.

  `setOnSubmitPayListener()`   is called by merchant applications to register a callback listener for payment or card binding submission status. This callback is triggered when a buyer initiates payment or card binding requests in the payment or card binding component UI (for example, by clicking the payment or card binding button).

## Method signature {#eFbmX}

 ```dart
Future<void> setOnSubmitPayListener(
  void Function(AMSStatusResult result) onSubmitPayCallback,
)
```

## Parameters {#T6L9y}

 | **Parameter** | **Data type** | **Is required?** | **Description** |
| --- | --- | --- | --- |
| [_onSubmitPayCallback_](#e76Rw) | Function | Yes | Callback function for payment or card binding submission status. Triggered when the buyer submits payment or card binding requests. |

### onSubmitPayCallback {#e76Rw}

 Payment or card binding submission callback function that receives an   `[AMSStatusResult](https://docs.antom.com/ac/sdks/flutter_AMSStatusResult.md)`   object containing the submission status.

 | **Parameter** | **Data type** | **Is required?** | **Description** |
| --- | --- | --- | --- |
| *result* | [AMSStatusResult](https://docs.antom.com/ac/sdks/flutter_AMSStatusResult.md) | Yes | Status results containing payment or card binding submission status and error details. |

## Return value {#mddjG}

 Return   `Future<void>`  to indicate that the listener registration submission for payment or card binding has been completed. The result of a payment or card binding submission is not returned by this return value, but by an asynchronous callback notification via   `onSubmitPayCallback`  .

## Error codes {#HWQXd}

 Error messages are returned via   `[AMSStatusResult](https://docs.antom.com/ac/sdks/flutter_AMSStatusResult.md)`   in the   `onSubmitPayCallback`   callback.

<!-- TabGroup -->

**Tab: Payment Element scenario**

| **Code (**      ***code***      **)** | **Status (**      ***status***      **)** | **Suggested prompt for buyers (**      ***message***      **)** | **Description** | **Further action** |
| --- | --- | --- | --- | --- |
| `UNKNOWN_EXCEPTION` | `PROCESSING` | Unknown exception. Please check the payment status and contact the merchant. | For unknown reasons, the method call failed. | Consult Antom Technical Support for detailed reasons. It is recommended that merchants try to poll the payment results from the server. If no payment result is found, you can reinitiate the payment using the original     *paymentSessionData*     within the validity period of the payment session. |
| `ORDER_IS_CANCELLED` | `FAIL` | The order status is abnormal. Please check the payment status and contact the merchant. | The order has been canceled. | The merchant cancels the order voluntarily, please check by yourself. |
| `ORDER_IS_CLOSED` | `FAIL` | The order status is abnormal. Please check the payment status and contact the merchant. | The request you initiated has the same     *paymentRequestId*     as the closed transaction. | The order has expired. Reinitiate the payment using the new     *paymentRequestId*    . |
| `INQUIRY_PAYMENT_SESSION_FAILED` | `FAIL` | The order status is abnormal. Please check the payment status and contact the merchant. | Payment session expires. | The order has expired. Reinitiate the payment using the new     *paymentRequestId*    . |
| `PAYMENT_IN_PROCESS` | `PROCESSING` | The payment is being processed, please wait for the payment to complete. | Payment is being processed. | Payment is being processed. It is recommended that merchants try to poll the payment results from the server. If no payment result is found, you can reinitiate the payment using the original     *paymentSessionData*     within the validity period of the payment session. |
| `PAYMENT_RESULT_TIMEOUT` | `PROCESSING` | An error occurred. The transaction cannot be initiated. | Network exception when getting payment results. | Try to poll payment results from the server side. |
| `USER_CANCELED` | `PROCESSING` | User manually canceled. | Users manually disable the code display or guidance page pop-up. | You can reinitiate the payment using the original     *paymentSessionData*     within the validity period of the payment session. |
| `INVALID_TRANSACTION` | `FAIL` | Invalid transaction. Do not retry, and contact Antom Technical Support for more details. | Invalid transaction. | The transaction is deemed invalid due to missing transaction parameters or formatting errors, risk control rule blocking, duplicate transaction submissions, or channels not supporting the transaction type. It is recommended to check the completeness of request parameters. |

**Tab: Payment Element saved‑card scenario**

| **Code (**      ***code***      **)** | **Status (**      ***status***      **)** | **Suggested prompt for buyers (**      ***message***      **)** | **Description** | **Further action** |
| --- | --- | --- | --- | --- |
| `UNKNOWN_EXCEPTION` | `PROCESSING` | Unknown exception. Please check the payment status and contact the merchant. | For unknown reasons, the method call failed. | It is recommended that merchants try to poll the payment results from the server. If no payment result is found, reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `INQUIRY_PAYMENT_SESSION_FAILED` | `FAIL` | The order status is abnormal. Please check the transaction status and contact the merchant. | Payment session expires. | The order has expired. Reinitiate the payment using the new     *paymentRequestId*    . |
| `USER_BALANCE_NOT_ENOUGH` | `FAIL` | The user's balance is insufficient. Please top up or choose another payment method. | Due to insufficient balance for the buyer using the corresponding payment method, payment cannot be completed. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `ORDER_NOT_EXIST` | `FAIL` | The order status is abnormal. Please check the payment status and contact the merchant. | The order does not exist. | Contact Antom Technical Support for detailed reasons. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `PROCESS_FAIL` | `FAIL` | Unknown exception. Please check the transaction status and contact the merchant. | A general business failure occurred. | Contact Antom Technical Support for detailed reasons. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `ORDER_IS_CANCELLED` | `FAIL` | The order status is abnormal. Please check the payment status and contact the merchant. | The order has been canceled. | The order has been canceled. If need to pay again, reinitiate the payment using the new    *paymentRequestId*     . |
| `RISK_REJECT` | `FAIL` | Risk control rejected. We recommend changing the card and trying again or contacting the card issuer. | The transaction cannot be further processed because of risk control. If the user has already paid for the transaction, the transaction will be refunded. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `ORDER_IS_CLOSED` | `FAIL` | The order status is abnormal. Please check the payment status and contact the merchant. | The request you initiated has the same    *paymentRequestId*    as that of the existed transaction, which is closed. | The order has expired. Use a new     *paymentRequestId*     to initiate the payment again. |
| `ACCESS_DENIED` | `FAIL` | Unknown exception. Please check the transaction status and contact the merchant. | Access is denied. | Contact Antom Technical Support for detailed reasons. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `CARD_EXPIRED` | `FAIL` | Your card has expired. Please check the expiration date or use a different card. | Card has expired. | Antom has already tipped buyers for you. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `INVALID_EXPIRY_DATE_FORMAT` | `FAIL` | The card expiration date is incorrect. Please check the expiration date or use a different card. | The format of     *expiryYear*     or     *expiryMonth*     is incorrect. | Antom has already tipped buyers for you. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `INVALID_EXPIRATION_DATE` | `FAIL` | The card expiration date is incorrect. Please check the expiration date or use a different card. | Values of     *paymentMethod.paymentMethodMetaData.expiryYear*     or     *paymentMethod.paymentMethodMetaData.expiryDate*     are invalid. | Antom has already tipped buyers for you. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `INVALID_CVV` | `FAIL` | The card CVV is incorrect. Please verify the CVV or use a different card. | The CVV of the card used for transactions is invalid. | Antom has already tipped buyers for you. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `INVALID_CARD_NUMBER` | `FAIL` | The card number is incorrect. Please try using a different card or contact the card issuer. | The card number used for the transaction is invalid. | Antom has already tipped buyers for you. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `SELECTED_CARD_BRAND_NOT_AVAILABLE` | `FAIL` | The card brand is not supported. We recommend changing the card and trying again or contacting the card issuer. | The card brand you specified for the transaction is not supported. | The card brand you specified is not supported. Check the card brand and reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `CARD_NOT_SUPPORTED` | `FAIL` | The card is not supported. Please try using a different card or contact the card issuer. | The card used for transactions is not supported. | Antom has already tipped buyers for you. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `CARD_BIN_QUERY_ERROR` | `FAIL` | The card number is incorrect. Please try using a different card or contact the card issuer. | The card number used for the transaction is invalid. | Antom has already tipped buyers for you. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `PAYMENT_IN_PROCESS` | `PROCESSING` `PENDING` | The payment is being processed, please wait for the payment to complete. | The payment is being processed. | `ROCESSING`       means that after SDK polling, no payment results were found, and it is recommended to poll the payment results on the server side.    Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. You can read the     *userCanceled3D*     field from the response to determine whether the buyer has proactively closed the 3D popup: - `true`  : indicates that the buyer proactively stopped the 3D process. - `false`  : indicates that the buyer did not proactively stop the 3D process. |
| `CURRENCY_NOT_SUPPORT` | `FAIL` | The merchant does not support this currency, and the transaction cannot be initiated. | The currency is not supported. | Contact Antom Technical Support for detailed reasons. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `INVALID_CARD` | `FAIL` | The card number is invalid. Please check the card details or use a different card. | The card is invalid. It could be that the card number cannot be recognized, the card does not have a corresponding issuing bank, or the card number format is incorrect. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `ISSUER_REJECTS_TRANSACTION` | `FAIL` | The issuing bank has declined the transaction. Please try using a different card or contact the card issuer. | The issuing bank has declined the transaction. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `INVALID_MERCHANT_STATUS` | `FAIL` | Merchant status is abnormal, and the transaction cannot be initiated. | Due to limitations, merchant status is abnormal. | Contact Antom Technical Support for detailed reasons. |
| `KEY_NOT_FOUND` | `FAIL` | Unknown exception. Please check the transaction status and contact the merchant | The private or public key of Antom or the merchant cannot be found. | Contact Antom Technical Support for detailed reasons. |
| `MERCHANT_KYB_NOT_QUALIFIED` | `FAIL` | Merchant status is abnormal, and the transaction cannot be initiated. | Payment failure due to abnormal KYB status. You may not have completed KYB, or KYB status may not apply to this transaction. | Contact Antom Technical Support for detailed reasons. |
| `NO_PAY_OPTIONS` | `FAIL` | No supported payment method. | There are no payment methods available. | Contact Antom Technical Support for detailed reasons. |
| `PARAM_ILLEGAL` | `FAIL` | Unknown exception. Please check the transaction status and contact the merchant | 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 wrong. | Contact Antom Technical Support for detailed reasons. |
| `PAYMENT_AMOUNT_EXCEED_LIMIT` | `FAIL` | Merchant status is abnormal, and the transaction cannot be initiated. | The payment amount exceeds the maximum allowed by the contract or payment method. | Check if the payment amount exceeds the limit, or try the payment again with a lower amount. Reinitiate the payment after replacing the amount with the new     *paymentRequestId*    . |
| `PAYMENT_COUNT_EXCEED_LIMIT` | `FAIL` | The number of payment attempts by the merchant has exceeded the limit, and the transaction cannot be initiated. | The number of payment attempts by the merchant has exceeded the limit. | Contact Antom Technical Support for detailed reasons. |
| `PAYMENT_NOT_QUALIFIED` | `FAIL` | Merchant status is abnormal, and the transaction cannot be initiated. | You are not eligible for payment because you are not registered, have not signed an automatic debit agreement, or are not allowed to pay. | Contact Antom Technical Support for detailed reasons. |
| `SUSPECTED_CARD` | `FAIL` | Risk control declined. Please try using a different card or contact your card issuer. | The card is suspected of fraud. For example, the card is stolen or restricted. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `SYSTEM_ERROR` | `FAIL` | Unknown exception. Please check the transaction status and contact the merchant. | A system error occurred. | Contact Antom Technical Support for detailed reasons. It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `USER_AMOUNT_EXCEED_LIMIT` | `FAIL` | The amount exceeds the limit. Please initiate the payment with an amount less than or equal to your available balance. | The payment amount exceeds the user payment limit. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `USER_KYC_NOT_QUALIFIED` | `FAIL` | Your account status is unusual. Please try using a different card or contact the card issuer.2 | 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). | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `USER_PAYMENT_VERIFICATION_FAILED` | `FAIL` | Your account status is unusual. Please try using a different card or contact the card issuer. | The user is restricted from payment on the payment method side. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `USER_STATUS_ABNORMAL` | `FAIL` | Your account status is unusual. Please try using a different card or contact the card issuer. | The user status is abnormal on the payment method side. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `DO_NOT_HONOR` | `FAIL` | The payment was declined by the card issuer. We recommend changing the card and trying again or contacting the card issuer. | The payment is declined by the issuing bank. | It is recommended to prompt buyers in a pop-up window. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `SUBMIT_PAYMENT_TIMEOUT` | `PROCESSING` | An error occurred. The transaction cannot be initiated. | Network anomalies when submitting payment. | Buyer network anomalies or Antom service anomalies. Try to poll payment results from the server side. If the payment result is not found, can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `PAYMENT_RESULT_TIMEOUT` | `PROCESSING` | An error occurred. The transaction cannot be initiated. | Network anomalies when obtaining payment results. | Try to poll payment results from the server side. If the payment result is not found, can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |
| `FORM_INVALID` | `FAIL` | Form validation exception. | Incorrect element information filling. | Antom has already tipped buyers for you. Can reinitiate   `confirmPayment()`   using the original     *paymentSessionData*     within the validity period of the payment session. |

<!-- /TabGroup -->