confirmPayment()
The
confirmPayment()
method is used for stored card payments in Payment Element, directly entering the payment confirmation process.Notes:
- This method must be called on the main thread.
- This method is mutually exclusive with.
Method signature
Java
Kotlin
Parameters
Parameter | Type | Required | Description |
activity | Activity | Yes | Current Activity context. |
sessionData | String | Yes | Payment session data. Pass the complete paymentSessionData obtained from the createPaymentSession (One-time Payments) API response into this parameter. |
Return value
This method does not return any value.
Error codes
UNKNOWN_EXCEPTION | PROCESSING | Unknown exception. Please check the payment status and contact the merchant. | An API call has failed, which is caused by unknown reasons. | For detailed reasons, please contact Antom technical support. It is recommended that you try to query the payment result from the server side. If the payment result is not found, you can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
INQUIRY_PAYMENT_SESSION_FAILED | FAIL | The order status is abnormal. Please check the payment status and contact the merchant. | Payment session expired. | The order has been closed due to timeout. Please initiate the payment again using a new paymentRequestId. |
PARAM_INVALID | N/A | Request exception, transaction cannot be initiated. | SDK input parameters exception. | Integration code is abnormal, please troubleshoot on your own. If you have any issues, contact Antom technical support. |
UI_STATE_ERROR | N/A | Request exception, transaction cannot be initiated. | The timing of creating SDK instance or calling the confirmPayment() method is abnormal. | Integration code is abnormal, please troubleshoot on your own. If you have any issues, contact Antom technical support. |
INITIALIZE_WEB_TIMEOUT | N/A | Request exception, transaction cannot be initiated. | Checkout static resource loading timeout. | User network exception or Antom service exception, it is recommended to re-call confirmPayment() . |
USER_BALANCE_NOT_ENOUGH | FAIL | The user's balance is insufficient. Please top up or choose another payment method. | Payment cannot be completed due to insufficient user balance for the corresponding payment method. | It is recommended to display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
ORDER_NOT_EXIST | FAIL | The order status is abnormal. Please check the payment status and contact the merchant. | Order does not exist. | Please contact Antom technical support for detailed reasons. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
PROCESS_FAIL | FAIL | System error. Please check your payment status and contact the merchant. | A general business failure occurred. | Please contact Antom technical support for detailed reasons. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
ORDER_IS_CANCELLED | FAIL | The order status is abnormal. Please check the payment status and contact the merchant. | Order has been cancelled. | The order has been cancelled. If you need to pay again, please initiate payment with a 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 display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
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 a closed transaction. | The order has timed out and been closed. Please initiate payment again with a new paymentRequestId. |
ACCESS_DENIED | FAIL | System error. Please check your payment status and contact the merchant. | Access is denied. | Please contact Antom technical support for detailed reasons. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
CARD_EXPIRED | FAIL | Your card has expired. Please check the expiration date or use a different card. | The card for payment has expired. | Antom has already prompted the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
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 prompted the buyer, you do not need to take any action. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
INVALID_EXPIRATION_DATE | FAIL | The card expiration date is incorrect. Please check the expiration date or use a different card. | The value of paymentMethod.paymentMethodMetaData.expiryYear or paymentMethod.paymentMethodMetaData.expiryDate is invalid. | Antom has already prompted the buyer, you do not need to take any action. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
INVALID_CVV | FAIL | The card CVV is incorrect. Please verify the CVV or use a different card. | The CVV code is invalid. | Antom has already prompted the buyer, you do not need to take any action. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
INVALID_CARD_NUMBER | FAIL | The card number is incorrect. Please try using a different card or contact the card issuer. | The number of the card used for the transaction is invalid. | Antom has already prompted the buyer, you do not need to take any action. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
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 that the user selected to pay is not available. | The card brand you specified is not supported, please investigate on your own. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
CARD_NOT_SUPPORTED | FAIL | The card is not supported. Please try using a different card or contact the card issuer. | The card used for the transaction is not supported. | Antom has already prompted the buyer, you do not need to take any action. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
CARD_BIN_QUERY_ERROR | FAIL | The card number is incorrect. Please try using a different card or contact the card issuer. | The number of the card used for the transaction is invalid. | Antom has already prompted the buyer, you do not need to take any action. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
PAYMENT_IN_PROCESS | PROCESSING PENDING | The payment is being processed, please wait for the payment to complete. | The payment is being processed. | When the status is PROCESSING , you can read userCanceled3D field from the response to determine whether the buyer actively closed the 3D popup:
|
CURRENCY_NOT_SUPPORT | FAIL | The merchant does not support this currency, and the transaction cannot be initiated. | The currency is not supported. | Please contact Antom technical support for detailed reasons. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
INVALID_CARD | FAIL | The card number is invalid. Please check the card details or use a different card. | Invalid card. The card number may be unrecognizable, the card does not have a corresponding issuing bank, or the card number format is incorrect. | It is recommended to display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
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 rejected the transaction. | It is recommended to display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
INVALID_MERCHANT_STATUS | FAIL | Merchant status is abnormal, and the transaction cannot be initiated. | The merchant status is abnormal because restrictions exist. | Please contact Antom technical support for detailed reasons. |
KEY_NOT_FOUND | FAIL | Unknown exception. Please check the payment status and contact the merchant. | The private key or public key of Antom or the merchant is not found. | Please contact Antom technical support for detailed reasons. |
MERCHANT_KYB_NOT_QUALIFIED | FAIL | Merchant status is abnormal, and the transaction cannot be initiated. | The payment failed because of the merchant's KYB status. The merchant is either not KYB compliant, or the KYB status is not qualified for this transaction. | Please contact Antom technical support for detailed reasons. |
NO_PAY_OPTIONS | FAIL | The merchant does not support this currency, and the transaction cannot be initiated. | No payment options are available. | Please contact Antom technical support for detailed reasons. |
PARAM_ILLEGAL | FAIL | Unknown exception. Please check the payment 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. | Please 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 is greater than the maximum amount allowed by the contract or payment method. | Check if the payment amount exceeds the limit, or retry payment with a lower amount. Initiate payment again with a new paymentRequestId after changing the amount. |
PAYMENT_COUNT_EXCEED_LIMIT | FAIL | The number of payment attempts by the merchant has exceeded the limit, and the transaction cannot be initiated. | The maximum number of payments exceeds the limit that is specified by the payment method. | Please contact Antom technical support for detailed reasons. |
PAYMENT_NOT_QUALIFIED | FAIL | Merchant status is abnormal, and the transaction cannot be initiated. | 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. | Please contact Antom technical support for detailed reasons. |
SYSTEM_ERROR | FAIL | Unknown exception. Please check the payment status and contact the merchant. | A system error occurred. | Please contact Antom technical support for detailed reasons.It is recommended to display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
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 display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
USER_KYC_NOT_QUALIFIED | FAIL | Your account status is unusual. Please try using a different card or contact the card issuer. | 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 display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
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 making payments on the payment method side. | It is recommended to display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
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 display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
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 display a pop-up notification to the buyer. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
SUBMIT_PAYMENT_TIMEOUT | PROCESSING | Request exception, transaction cannot be initiated. | Network error occurred when submitting the payment. | Buyer network exception or Antom service exception, try to query the payment result from the server side. If the payment result is not found, you can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
PAYMENT_RESULT_TIMEOUT | PROCESSING | Request exception, transaction cannot be initiated. | Network error occurred when obtaining payment result. | Try to query the payment result from the server side. If the payment result is not found, you can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |
FORM_INVALID | FAIL | N/A | Element information is incorrect. | Antom has already prompted the buyer, you do not need to take any action. You can use the original paymentSessionData to re-call the confirmPayment() method within the session validity period. |