Retrieve card tokenization results
Last updated: October 6, 2025
Use the onTokenized callback to monitor the outcome of tokenizing the payment card. For example, if you want to conduct a pre-payment risk check with the card's details and decide whether to proceed with 3D Secure authentication or cancel the payment.
Information
Follow the Getting started with Flow for mobile guide before you update your integration with the steps outlined on this page.
The onTokenized event triggers when the card is tokenized and returns a Request card metadata response.
Add the event to the initialization code for your Flow instance. Then, implement the event logic to customize the payment flow depending on the tokenization result. For example, the following code uses the outcome to perform a fraud check and cancels the payment if the check fails:
1val callbacks = ComponentCallback(2onTokenized = { tokenizationResult ->3runBlocking {4// Perform risk check with the tokenization result. For example, using a suspend function to5// send the data to a third-party risk tool:6val cardRiskCheckResult = performRiskCheck(tokenizationResult)7if (cardRiskCheckResult.result == "abort") {8CallbackResult.Rejected("This card is not supported.")9} else {10CallbackResult.Accepted11}12}13}14)15val configuration = CheckoutComponentConfiguration(16componentCallback = callbacks17)
The handleSubmit event enables you to submit a modified payment session.
Add the event to the initialization code for your Flow for mobile configuration.
Implement the callback logic to provide the payment submission data to your server-side integration:
1suspend fun handleSubmit(sessionData: SessionData): ApiCallResult {2handlePaymentSubmission()3}4val callback = ComponentCallback(handleSubmit = ::handleSubmit)
Call the Submit a payment session endpoint and provide the payment session ID as the {id} path parameter.
In your request, provide the payment session data from the handleSubmit event in session_data. You can also modify any of the following fields:
3dsamountitemsreference
post
https://api.checkout.com/payment-sessions/{id}/submit
1{2"session_data": "{SESSION_DATA_FROM_FLOW}",3"3ds": {4"enabled": true5}6}
1{2"id": "pay_f2ws3hn4ijquzbytp3v5lsfxge",3"status": "Action Required",4"type": "card",5"action": {6"type": "3ds",7"url": "http://3ds2.checkout.com/interceptor/sid_y3oqhf46pyzuxjbcn2giaqnb44"8}9}
You must provide the unmodified response to the handleSubmit event in the client-side integration. Flow handles any additional required actions.