createComponent()
The createComponent() method is used to create and display the payment or card binding component UI.
Notes:
- This method must be called on the main thread.
- This method is mutually exclusive with confirmPayment().
Method signature
Java
public void createComponent(Activity activity, String sessionData)Kotlin
fun createComponent(activity: Activity, sessionData: String)Parameters
Parameters | Type | Required | Description |
activity | Activity | Yes | The current Activity context used to display the payment or card binding component. |
sessionData | String | Yes | Payment or vaulting session data. Complete the corresponding configuration according to different scenarios:
|
Return value
This method does not return any value.
Error codes
Payment Element scenario
code | status | Suggested prompt for buyers (message) | Description | Recommended action |
|---|---|---|---|---|
UNKNOWN_EXCEPTION | PROCESSING | Unknown exception. Please check the payment status and contact the merchant. | Due to unknown reasons, the API call failed. | 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 the original paymentSessionData to re-call the createComponent() 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 merchant cancelled the order, please investigate on your own. |
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 been closed due to timeout. Please initiate the payment again using a new paymentRequestId. |
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 createComponent() 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 the createComponent() method. |
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 you try to query the payment result from the server side. If the payment result is not found, you can the original paymentSessionData to re-call the createComponent() method within the session validity period. |
PAYMENT_RESULT_TIMEOUT | PROCESSING | Request exception, transaction cannot be initiated. | Network exception when obtaining payment result. | Try to query the payment result from the server side. |
USER_CANCELED | PROCESSING | N/A | User manually closed the QR code display/guidance page popup. | Within the session validity period, you may use the original paymentSessionData to call the createComponent() method again. |
INVALID_TRANSACTION | FAIL | Transaction failed. Please try again later or choose another payment method. | Invalid transaction. | The transaction is deemed invalid. Possible reasons: missing/incorrect transaction parameters, risk control rules interception, duplicate transaction submission, or the channel does not support this transaction type. It is recommended to check the completeness of request parameters, guide the users to retry later or change the payment method. |
Vaulting Element scenario
code | status | Suggested prompt for buyers (message) | Description | Recommended action |
|---|---|---|---|---|
UNKNOWN_EXCEPTION | PROCESSING | Unknown exception. Please check the payment status and contact the merchant. | The API call failed due to an unknown reason. | Try polling the result from the server side. |
PROCESS_FAIL | FAIL | System error. Please check your payment status and contact the merchant. | A common business failure occurred. | Contact Antom Technical Support for details. |
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 specified by the merchant is not supported. | The card brand specified by the merchant is not supported. Check your configuration. |
RISK_REJECT | FAIL | Risk control rejected. We recommend changing the card and trying again or contacting the card issuer. | Authentication cannot proceed due to risk control. | Contact Antom Technical Support for details. |
USER_BALANCE_NOT_ENOUGH | FAIL | The user's balance is insufficient. Please top up or choose another payment method. | The payment cannot be completed because the user has insufficient balance for the selected payment method. | Antom has already notified the user. No further action is required from the merchant. |
ACCESS_DENIED | FAIL | System error. Please check your payment status and contact the merchant. | Access is denied. | Contact Antom Technical Support for details. |
CARD_EXPIRED | FAIL | Your card has expired. Please check the expiration date or use a different card. | The card has expired. | Antom has already notified the user. No further action is required from the merchant. |
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 notified the user. No further action is required from the merchant. |
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 notified the user. No further action is required from the merchant. |
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 notified the user. No further action is required from the merchant. |
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 notified the user. No further action is required from the merchant. |
FRAUD_REJECT | FAIL | We apologize, but we are unable to process this transaction at this time. If a payment was involved, the funds will be automatically refunded to your payment account; no further action is required. | The transaction cannot proceed due to risk control. If the user has already paid for the transaction, the payment will be refunded. | Risk control rejection: the transaction was terminated because it triggered risk control rules. |
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 was declined by the card issuer. | Try using another card, or contact the card issuer. |
PICKUP_CARD | FAIL | Card Not Allowed. Please try another card. | The card issuer requires the merchant to retain the payment card. This typically occurs in suspected counterfeit-card or fraudulent-use scenarios. | Contact the card issuer immediately, or use another card to complete the payment. |
ACCOUNT_CLOSED | FAIL | Card Not Allowed. Please try another card. | The account has been closed. Verify that the account number is correct, and do not process the same card number or token again. | Contact the card issuer immediately, or use another card to complete the payment. |
RESTRICTED_CARD | FAIL | Card restricted. Contact your bank or try another card. | The card issuer has restricted the usage scope of this card. | Contact the card issuer immediately, or use another card to complete the payment. |
BLOCKED_FIRST_USED | FAIL | Blocked by bank. Contact your bank or try another card. | The card may be temporarily blocked because it has not been activated for first use or is subject to special restrictions, such as a newly issued inactive card. | The cardholder should activate the new card, or contact the card issuer to confirm the temporary block status and applicable conditions. |
POLICY | FAIL | Payment declined by bank. Try again or another card. | The transaction is restricted by policy. | The cardholder should contact the card issuer to confirm the reason. |
PAYMENT_AMOUNT_EXCEED_LIMIT | FAIL | Merchant status is abnormal, and the transaction cannot be initiated. | The payment amount exceeds the maximum amount allowed by the contract or payment method. | Check whether the payment amount exceeds the limit, or retry with a lower amount. Contact Antom Technical Support for details about the specific limit. |
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 notified the user. No further action is required from the merchant. |
VERIFICATION_IN_PROCESS | PROCESSING | Card binding in progress, please wait. | Payment method verification is in progress. | PROCESSING indicates that the SDK did not obtain the authentication result after polling. Poll the authentication result from the server side. |
ORDER_IS_CLOSED | FAIL | The order status is abnormal. Please check the payment status and contact the merchant. | The transaction is closed and the card cannot be bound again. | The order has timed out and been closed. Initiate the request again with a new vaultingRequestId. |
PARAM_ILLEGAL | FAIL | Unknown exception. Please check the payment status and contact the merchant. | A required parameter is missing or an invalid parameter is provided. For example, non-numeric input, an invalid date, or an incorrect parameter length or type. | Check and verify that all required request fields, including header fields and body fields, are correctly passed and valid. |
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 payments exceeds the maximum limit allowed by the payment method. | Contact Antom Technical Support for details. |
STOLEN_CARD | FAIL | Your bank card is in an abnormal state. Please contact your issuing bank or use an alternative payment method to complete the payment. | The card is reported as stolen, indicating a fraudulent account. | The cardholder should contact the card issuer to confirm the reason. |
LOST_CARD | FAIL | Your bank card is in an abnormal state. Please contact your issuing bank or use an alternative payment method to complete the payment. | The card is reported as lost, indicating a fraudulent account. | The cardholder should contact the card issuer to confirm the reason. |
AUTHENTICATION_REQUIRED | FAIL | Additional authentication is required to complete your payment. | 3D Secure authentication is required. | Restart the payment and guide the user to complete 3D Secure authentication. |
VERIFY_TIMES_EXCEED_LIMIT | FAIL | Too many failed attempts. Please request a new verification code. | The current verification code has failed too many times during payment verification. | The user must obtain a new verification code. |
USER_PAYMENT_VERIFICATION_FAILED | FAIL | Your account status is unusual. Please try using a different card or contact the card issuer. | The buyer failed payment verification using the OTP verification method. | Display a prompt to the user. |
PARAM_INVALID | N/A | Request exception, transaction cannot be initiated. | The SDK input parameters are invalid. | Check your integration code. If the issue persists, contact Antom Technical Support. |
UI_STATE_ERROR | FAIL | Request exception, transaction cannot be initiated. | The API was called at an invalid time or in an invalid state. | Check your integration code. If the issue persists, contact Antom Technical Support. |
INITIALIZE_WEB_TIMEOUT | N/A | Request exception, transaction cannot be initiated. | The checkout static resources failed to load within the timeout period. | The issue may be caused by the user's network or an Antom service exception. Retry the operation. |
UNKNOWN_ERROR | FAIL | An unknown error occurred. Please try again later or contact the merchant. | An unknown exception occurred. This is a fallback error. | Prompt the user to resolve the form error. |
API_GATEWAY_TIMEOUT | PROCESSING | Request timed out. Please try again. | The API gateway timed out. | Prompt the user. |
API_TIMEOUT | PROCESSING | Request timed out. Please try again. | The API response timed out. | Prompt the user. |
API_GATEWAY_ERROR | FAIL | System error. Please try again later or contact the merchant. | An API gateway error occurred. | Prompt the user to resolve the form error. |
API_SYSTEM_ERROR | FAIL | System error. Please try again later or contact the merchant. | An error occurred during the API call. | Prompt the user to resolve the form error. |
VALIDATION_FAILED | FAIL | Form validation failed. | Form validation failed. | Prompt the user to resolve the form error. |
INQUIRY_RESULT_TIMEOUT | PROCESSING | Request timed out. Please try again. | The card binding result inquiry timed out. | Prompt the user. |
MISSING_SUCCESS_REDIRECT_URL | FAIL | System error. Please try again later or contact the merchant. | The success redirect URL is missing. | Prompt the user. Contact Antom Technical Support for details. |
MISSING_3D_REDIRECT_URL | FAIL | System error. Please try again later or contact the merchant. | The 3D Secure redirect URL is missing. | Prompt the user. Contact Antom Technical Support for details. |
NOT_SUPPORT_SUBMIT | FAIL | System error. Please try again later or contact the merchant. | The submitted Element is not supported. | Update your integration code. Do not submit an Element that does not support submission. |
INVALID_MODAL_URL | FAIL | System error. Please try again later or contact the merchant. | The modal URL is invalid. | Prompt the user. Contact Antom Technical Support for details. |
INVALID_REDIRECT_URL | FAIL | System error. Please try again later or contact the merchant. | The redirect URL is invalid. | Check whether the configured redirect URL is valid. |
DDC_UPLOAD_PARAM_ILLEGAL | FAIL | System error. Please try again later or contact the merchant. | The DDC upload parameters are invalid. | Prompt the user. Contact Antom Technical Support for details. |
DDC_UPLOAD_DATA_FAILED | FAIL | System error. Please try again later or contact the merchant. | The DDC channel page encountered an error. | Prompt the user. Contact Antom Technical Support for details. |
DDC_QUERY_ID_MISSING | FAIL | System error. Please try again later or contact the merchant. | An error occurred while querying the DDC result. | Prompt the user. Contact Antom Technical Support for details. |
DDC_QUERY_INFO_MISSING | FAIL | System error. Please try again later or contact the merchant. | An error occurred while querying the DDC result. | Prompt the user. Contact Antom Technical Support for details. |
DDC_QUERY_INFO_UUID_MISSING | FAIL | System error. Please try again later or contact the merchant. | An error occurred while querying the DDC result. | Prompt the user. Contact Antom Technical Support for details. |
DDC_PARAMETERS_INVALID | FAIL | System error. Please try again later or contact the merchant. | Required 3DE parameters are missing. | Prompt the user. Contact Antom Technical Support for details. |
DDC_INQUIRY_3D_REDIRECT_URL_PARAMS_MISSING | FAIL | System error. Please try again later or contact the merchant. | Required 3DE parameters are missing. | Prompt the user. Contact Antom Technical Support for details. |
DDC_QUERY_PAYMENT_REDIRECT_URL_TIMEOUT | PROCESSING | Request timed out. Please try again. | Querying the payment redirect URL timed out. | Prompt the user. |
NOT_SUPPORT_ELEMENT | FAIL | System error. Please try again later or contact the merchant. | The specified elementType is not supported. | Update your integration code. Do not create an unsupported Element. |
SESSION_DATA_INVALID | FAIL | System error. Please try again later or contact the merchant. | The provided sessionData is invalid. | Check your integration code and verify that the provided sessionData is correct. |
ELEMENT_INIT_FAILED | FAIL | System error. Please try again later or contact the merchant. | Failed to initialize the Element. | Prompt the user. Contact Antom Technical Support for details. |
GENERATE_ELEMENT_KEY_FAILED | FAIL | System error. Please try again later or contact the merchant. | Failed to generate a unique key for the Element. | Prompt the user. Contact Antom Technical Support for details. |
CANNOT_CREATE_SAME_ELEMENT_TWICE | FAIL | System error. Please try again later or contact the merchant. | The same Element was created multiple times. | Update your integration code. Do not create the same Element more than once at the same time. |
MOUNT_TIMEOUT | FAIL | System error. Please try again later or contact the merchant. | Mounting the Element timed out. | Prompt the user. Contact Antom Technical Support for details. |
MOUNT_MISSING_CONTAINER | FAIL | System error. Please try again later or contact the merchant. | No container element was provided for mounting. | Update your integration code and provide a valid container element. |
MOUNT_IFRAME_LOAD_ERROR | FAIL | System error. Please try again later or contact the merchant. | Failed to load the iframe. | Prompt the user. Contact Antom Technical Support for details. |
MOUNT_NOT_SUPPORT | FAIL | System error. Please try again later or contact the merchant. | The Element cannot be mounted in the current state. This may occur after the Element has been destroyed or when mounting is attempted multiple times. | Update your integration code. Do not mount an Element again after it has been destroyed. |
MOUNT_INITIAL_FAILED | FAIL | System error. Please try again later or contact the merchant. | Failed to initialize mounting. | Prompt the user. Contact Antom Technical Support for details. |
MISSING_PAYMENT_METHOD | FAIL | System error. Please try again later or contact the merchant. | The rendering template was not provided. | Prompt the user. Contact Antom Technical Support for details. |
USER_CLOSE_VAULTING | PROCESSING | N/A | The user closed the card binding semi-modal. | No further action is required from the merchant. |