Antom, leading provider of tailored payment solutions

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
javascript
antom.confirmPayment(params);
TypeScrip
typescript
// 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:
  • When elements is not passed in, this parameter is required and is used to specify the current payment session data.
  • When elements is passed in, you do not need to pass this parameter again. Even if it is passed in, it will not override the session bound when the CVVElement was created.
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 CVVElementinstance. Valid values:
  • CVV: The following configurations are available in the CVVElement scenario:
  • 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: No redirect URL is returned. The merchant must handle the subsequent redirection logic, including whether to redirect, the redirection method, and the redirection destination.

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.
  • PROCESSING: Payment processing.
  • FAIL: Payment failed.
  • CANCELLED: Payment canceled.
userCanceled3D
Boolean
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.
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.