confirmPayment()

confirmPayment() is called by merchant applications to submit and confirm payment for the current component instance.

Notes:

Method signature

copy
Future<void> confirmPayment(
  String paymentSessionData,
  void Function(AMSStatusResult) onResult,
)

Parameters

Parameter

Data type

Is required?

Description

paymentSessionData

String

Yes

Payment session data. Pass the complete paymentSessionData value obtained from the createPaymentSession (One-time Payments) API response into this parameter.

onResult

Function

Yes

Initialization result callback function. Used to return the result of successful or failed initialization.

onResult

The result callback from the confirmPayment() method receives an AMSStatusResult object indicating whether the payment confirmation was successful.

Parameter

Data type

Is required?

Description

result

AMSStatusResult

Yes

Status results containing payment confirmation status and error details.

Return value

This method returns no value, and the confirmation result is returned asynchronously through the onResult callback.

Error codes

code

status

Suggested prompt to buyers (message)

Description

Further action

PARAM_INVALID

N/A

An error occurred. The transaction cannot be initiated.

SDK input parameters are abnormal.

Integration code exception. Troubleshoot yourself required. If the problem persists, contact Antom Technical Support.

UI_STATE_ERROR

N/A

An error occurred. The transaction cannot be initiated.

Abnormal timing when creating SDK instances or createComponent().

Integration code exception. Troubleshoot yourself required. If the problem persists, contact Antom Technical Support.

INITIALIZE_WEB_TIMEOUT

N/A

An error occurred. The transaction cannot be initiated.

The checkout page static resource loading had timed out.

Buyer network exception or Antom service exception detected. Retry the createComponnet() method.