antom.confirmPayment()
The antom.confirmPayment() method is used to confirm and submit a payment.
- In a saved-card payment scenario, the SDK determines, based on the configuration, whether CVV information needs to be collected, and handles the redirection flow after the payment.
- In an Express Checkout scenario, it is usually called in the callback function of the confirm event after the event is triggered, to continue and complete the payment process.
Method signature
When calling this method, please use the following standard method signature format.
Parameters
This method includes the following parameter:
JavaScript
antom.confirmPayment(params);
TypeScrip
// CVV Element
antom.confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResult>
// Express Element
antom.confirmPayment(params: ConfirmPaymentOptions): Promise<SubmitResult>
Parameters
This method includes the following parameter:
Parameter | Data type | Required | Description |
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 |
sessionData | String | No | Payment session data used to identify the current payment. Notes:
|
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 |
|
redirect | String | No | The redirection policy. Valid values are:
|
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:
|
userCanceled3D | Boolean | No | Indicates whether the buyer actively closed the 3D Secure authentication popup. Valid values are:
|
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 | |
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. |