confirmPayment()
confirmPayment() is called by merchant applications to submit and confirm payment for the current component instance.
Notes:
- This method should typically be called within the callback of
setOnSubmitPayListener().- This method is mutually exclusive with
createComponent().- paymentSessionData must be obtained from the server's createPaymentSession (One-time Payments) API response.
Method signature
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. |
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 | 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 |
| 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. |
| N/A | An error occurred. The transaction cannot be initiated. | Abnormal timing when creating SDK instances or | Integration code exception. Troubleshoot yourself required. If the problem persists, contact Antom Technical Support. |
| 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 |