antom.confirmPayment()

The antom.confirmPayment() method is used in saved‑card payment scenarios. When you initiate a payment with a specified saved card, the method automatically determines whether CVV verification is required and how to handle the post‑payment redirection process based on the configuration parameters.

Method signature

When calling this method, please use the following standard method signature format.

copy
antom.confirmPayment(params)

Parameters

This method includes the following parameter:

Parameter

Data type

Required

Description

params

Object

Yes

The payment confirmation parameter object, which contains configurations for session data, an Element instance, and the redirect strategy.

 params

Parameter

Data type

Required

Description

sessionDataString

Yes

Payment session data used to identify the current payment.

appearance

Object

No

Appearance settings, applicable only in scenarios where CVV collection is not required (No‑UI payment). For more details, see Appearance customization.

elements

String

No

The mounted CVVElement instance.

  • Not provided: No‑UI payment, CVV is not collected.
  • Provided custom CVV element: CVV is collected through the specified element.
redirect

String

No

The redirection policy. Valid values are:

  • always: The SDK automatically redirects or opens the app.  
  • if_required: Redirect only when the payment method requires it; otherwise, the merchant handles the return URL.

Return value

This method returns a Promise object that resolves to a payment result object, which includes the following sub-parameters:

Parameter

Data type

Required

Description

status

String

Yes

Payment status. You can simplify the integration processing based on the value of status. You may also perform refined exception handling based on error?.code. Valid values are:

  • SUCCESS: Payment succeeded.
  • PROCESSINGPayment processing.
  • FAILPayment failed.
  • CANCELLEDPayment canceled.
userCanceled3DBoolean

No

Indicates whether the buyer actively closed the 3D Secure authentication popup. Valid values are:

  • true: Buyer actively terminated the 3D process. When this value is returned, it is recommended to poll the result from the server.
  • false: 3D process was not terminated by the buyer.
error

Object

No

This parameter is only returned when the operation fails, and is an error object containing code and message parameters. If not returned, the operation was successful.

error

Parameter

Data type

Required

Description

code

String

Yes

Error code.

message

String

Yes

Error message.

traceId

String

No

Trace ID for log trace queries.

context

Any

No

Error context information.

needChangeSessionForRetry

Boolean

No

Indicates whether the session needs to be changed for retry.