# 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.

#### Tab: JavaScript

```javascript
antom.confirmPayment(params)
```

#### Tab: TypeScript

```typescript
antom.confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResult>
```

## Parameters

This method includes the following parameter:

| **Parameter** | **Data type** | **Required** | **Description** |
| --- | --- | --- | --- |
| [_params_](#u3HyN) | 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 | 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](https://docs.antom.com/ac/cashierpay/appearance.md). |
| _elements_ | String | No | The mounted [`CVVElement`](https://docs.antom.com/ac/sdks/web_CVVElement.md) instance.<br/><br/>- Not provided: No‑UI payment, CVV is not collected.<br/>- Provided custom CVV element: CVV is collected through the specified element. |
| _redirect_ | String | No | The redirection policy. Valid values are:<br/><br/>- `always`: The SDK automatically redirects or opens the app.<br/>- `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:<br/><br/>- `SUCCESS`: Payment succeeded.<br/>- `PROCESSING`: Payment processing.<br/>- `FAIL`: Payment failed.<br/>- `CANCELLED`: Payment canceled. |
| _userCanceled3D_ | Boolean | No | Indicates whether the buyer actively closed the 3D Secure authentication popup. Valid values are:<br/><br/>- `true`: Buyer actively terminated the 3D process. When this value is returned, it is recommended to poll the result from the server.<br/>- `false`: 3D process was not terminated by the buyer. |
| [_error_](#AMRcr) | 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. |