Access payment details from a wallet
Last updated: November 11, 2026
Use the onAuthorized event to check the card details the customer provides in a digital wallet. For example, if you want to stop the payment when they select a credit card or a specific card scheme.
Information
Use Flow for mobile SDK version 2.10.0 or later. Follow the Google Pay for Android or Apple Pay for iOS guide before you update your integration with the steps outlined on this page.
Flow for mobile raises the onAuthorized event after the customer authorizes the payment in the wallet sheet, but before it submits the payment. The callback receives the card details from the wallet, so you can accept or reject the payment before it's processed.
Add the event to the component callbacks you provide in your Flow for mobile configuration. The event applies whether you render the wallet component on its own or within Flow.
- To accept the payment, return the accepted result. If you do not provide the callback, Flow for mobile accepts the payment.
- To reject the payment, return the rejected result with a message. Flow for mobile does not submit the payment and displays your message to the customer below the wallet's payment button.
For example, the following code rejects the payment if the customer selects a credit card stored in the wallet:
1val callback = ComponentCallback(2onAuthorized = { authorization ->3// Reject credit cards4if (authorization.cardType == "CREDIT") {5CallbackResult.Rejected("Credit cards are not accepted.")6} else {7// Otherwise, allow the payment to proceed8CallbackResult.Accepted9}10},11)
The callback is synchronous, so base your decision on the card details the wallet provides and avoid network requests. For the properties available on each platform, see the ComponentCallback reference for Android and iOS.
If you accept the payment, Flow for mobile submits it and you receive the outcome through your existing onSuccess and onError callbacks, the same as any other wallet payment.
If you reject the payment, onError is not called. On iOS, onError is called with paymentCancelled if the customer then closes the Apple Pay sheet.
If you accept the payment and provide a handleSubmit callback, Flow for mobile passes SessionData to it instead of submitting the payment itself. Send that data to your server and call the Submit a payment session endpoint with the session token in session_data. Provide the endpoint's unmodified response body to Flow for mobile through the callback's result so it can handle any additional required actions.
You can obtain the payment response for both asynchronous and synchronous payments.