antom.confirmCardSetup()

antom.confirmCardSetup() method is used in card vaulting scenarios. It takes a mounted VaultingElement instance to submit the binding request and returns a Promise object that resolves with the binding result.

Note:

  • Before calling antom.confirmCardSetup(), you must first call element.mount() to mount the element to the DOM.
  • If the binding process requires 3D verification, the SDK will automatically display a verification window, and the process will continue after the user completes the verification.
  • The PROCESSING status indicates that the binding is still in progress. It is recommended to poll the final status via the server-side API.

Method signature

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

copy
antom.confirmCardSetup(options)

Parameters

This method includes the following parameter:

Parameter

Data type

Required

Description

options

Object

Yes

An object for card setup confirmation, containing the mounted Element instance and redirect policy configuration.

options

Parameter

Data type

Required

Description

elements

String

Yes

The mounted VaultingElement instance.

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 card binding result object, which includes the following sub-parameters:

Parameter

Data type

Required

Description

status

String

Yes

Vaulting 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: Vaulting succeeded.
  • PROCESSING: Vaulting processing.
  • FAIL: Vaulting failed.
  • CANCELLED: Vaulting 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 issue investigation.

context

Any

No

Error context information.

Error codes

Use the element.on() method to listen for error codes related to the antom.confirmCardSetup() method. For a detailed list of error codes, please refer to the Error codes.