--- title: "Android Component" description: "Add Twint to your Components integration." url: "https://docs.adyen.com/payment-methods/twint/android-component" source_url: "https://docs.adyen.com/payment-methods/twint/android-component.md" canonical: "https://docs.adyen.com/payment-methods/twint/android-component" last_modified: "2026-05-24T12:54:31+02:00" language: "en" --- # Android Component Add Twint to your Components integration. [View source](/payment-methods/twint/android-component.md) You can add Twint to your existing integration. The following instructions show only what you must add to your integration specifically for Twint. If an instruction on this page corresponds with a step in the main integration guide, it includes a link to corresponding step of the main integration guide. The additions you must make depends on the [server-side flow](/online-payments/build-your-integration) that your integration uses: ## Sessions flow Component ### Before-You-Begin ## Requirements | Requirement | Description | | | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Sessions flow [Android Components integration](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components). | | | **Checkout API** | Make sure that you use Checkout API v68 or later. | | | **Setup steps** | Before you begin, [add Twint in your Customer Area](/payment-methods/add-payment-methods). | | ### Add-Parameters-Sessions-Request ## Add additional parameters to your /sessions request You do not need to add any parameters when you [create a payment session](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#create-a-payment-session). ### Import-Component ## Import the Component for Twint To [import the library](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#import) and include the module for Twint. ### Tab: With Jetpack Compose **Import the module with Compose** ```java implementation "com.adyen.checkout:twint:YOUR_VERSION" implementation "com.adyen.checkout:components-compose:YOUR_VERSION" ``` ### Tab: Without Jetpack Compose **Import the module without Compose** ```java implementation "com.adyen.checkout:twint:YOUR_VERSION" ``` ### Add-Configuration ## Add additional configuration for Twint [Add a configuration object](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#3-optional-add-a-configuration-object) with the following parameters: | Parameter | Required | Description | | ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- | | setSubmitButtonVisible | | Set if you want the submit button to be visible. | | setActionHandlingMethod | | Use this parameter to configure the method used to handle actions. | | setShowStorePaymentField | | Set if the option to store the shopper's account for future payments should be shown as an input field. Default is **true**. | **Add a configuration object** ```kotlin CheckoutConfiguration( ... ) { twint { setSubmitButtonVisible(value) setActionHandlingMethod(value) setShowStorePaymentField(value) } } ``` ### Launch-And-Show ## Launch and show the Component for Twint To [create the Component](/online-payments/build-your-integration/sessions-flow?platform=Android\&integration=Components#launch-and-show) for Twint, use the `TwintComponent` class. ### Tab: With Jetpack Compose **Launch and show the Component** ```kotlin import com.adyen.checkout.components.compose.get // Get the payment method. val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.TWINT) @Composable private fun ComposableTwintComponent() { // Keep a reference to this Component in case you need to access it later. val twintComponent = TwintComponent.PROVIDER.get( checkoutSession = checkoutSession, paymentMethod = paymentMethod, configuration = checkoutConfiguration, componentCallback = callback, // This key is required to ensure a new Component gets created for each different screen or payment session. // Generate a new value for this key every time you need to reset the Component. key = "YOUR_UNIQUE_KEY_FOR_THIS_COMPONENT", ) // This is your composable, a wrapper around our xml view. AdyenComponent( component = twintComponent, modifier = YOUR_MODIFIER, ) } ``` ### Tab: Without Jetpack Compose ```kotlin // Get the payment method. val paymentMethod = checkoutSession.getPaymentMethod(PaymentMethodTypes.TWINT) val twintComponent = TwintComponent.PROVIDER.get( activity, // Your activity or fragment. checkoutSession, paymentMethod, checkoutConfiguration, componentCallback ) // Attach the Component to your view. binding.twintView.attach(twintComponent, activity) // Your activity or fragment. ``` ### Recurring ## Recurring payments To make recurring payments for TWINT, you need to: 1. [Create a shopper token](#create-a-token). 2. [Use the token to make future payments for the shopper](#make-payment-with-token). ### Create a token To create a token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: * `storePaymentMethod`: **true** * [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): Your unique identifier for the shopper (minimum length three characters). When the payment details have been stored, you receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) [webhook](/development-resources/webhooks) containing: * `type`: **recurring.token.created** * `shopperReference`: your unique identifier for the shopper. * `eventId`: the `pspReference` of the initial payment. * `storedPaymentMethodId`: the token that you need to make recurring payments for this shopper. Make sure that your server is able to receive the [Recurring tokens life cycle events](/development-resources/webhooks/webhook-types/#other-webhooks) webhook. You can [set up this webhook in your Customer Area](/development-resources/webhooks/#set-up-webhooks-in-your-customer-area). ### Make a payment with a token To make a payment with the token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: * `paymentMethod.storedPaymentMethodId`: The `storedPaymentMethodId` from the [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook. You can also get this value using the [/listRecurringDetails](https://docs.adyen.com/api-explorer/Recurring/latest/post/listRecurringDetails) endpoint. * `shopperReference`: The unique shopper identifier that you specified when creating the token (minimum length three characters). * `shopperInteraction`: **ContAuth**. * `recurringProcessingModel`: **Subscription** or **UnscheduledCardOnFile**. For more information about the `shopperInteraction` and `recurringProcessingModel` fields, refer to [Tokenization](/online-payments/tokenization/). ## Test and go live Check the status of TWINT test payments in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**. Before you can accept live TWINT payments, you need to [submit a request for TWINT](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## Advanced flow Component ## Requirements | Requirement | Description | | | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | - | | **Integration type** | Make sure that you have an existing Advanced flow [Android Components integration](/online-payments/build-your-integration/advanced-flow?platform=Android\&integration=Components). | | | **Action handling** | Make sure that your existing integration is set up to [handle the additional action](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#additional-action). `action.type`: redirect or sdk. | | | **Setup steps** | Before you begin, [add Twint in your Customer Area](/payment-methods/add-payment-methods). | | ### Import ## Import the Component for Twint To [import the library](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#import) and include the module for Twint. ### Tab: With Jetpack Compose **Import the module with Compose** ```java implementation "com.adyen.checkout:twint:YOUR_VERSION" implementation "com.adyen.checkout:components-compose:YOUR_VERSION" ``` ### Tab: Without Jetpack Compose **Import the module without Compose** ```java implementation "com.adyen.checkout:twint:YOUR_VERSION" ``` ### Add Configuration ## Add additional configuration for Twint [Add a configuration object](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#3-optional-add-a-configuration-object) with the following parameters: | Parameter | Required | Description | | ------------------------ | -------- | ---------------------------------------------------------------------------------------------------------------------------- | | setSubmitButtonVisible | | Set if you want the submit button to be visible. | | setActionHandlingMethod | | Use this parameter to configure the method used to handle actions. | | setShowStorePaymentField | | Set if the option to store the shopper's account for future payments should be shown as an input field. Default is **true**. | **Add a configuration object** ```kotlin CheckoutConfiguration( ... ) { twint { setSubmitButtonVisible(value) setActionHandlingMethod(value) setShowStorePaymentField(value) } } ``` ### Launch And Show ## Launch and show the Component for Twint To [create the Component](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#launch-and-show) for Twint, use the `TwintComponent` class. ### Tab: With Jetpack Compose **Launch and show the Component** ```kotlin import com.adyen.checkout.components.compose.get // Create the payment method object from the /paymentMethods response. val paymentMethod = paymentMethodsApiResponse?.paymentMethods.orEmpty().firstOrNull { it.type == PaymentMethodTypes.TWINT } @Composable private fun ComposableTwintComponent() { // Keep a reference to this Component in case you need to access it later. val twintComponent = TwintComponent.PROVIDER.get( paymentMethod = paymentMethod, configuration = checkoutConfiguration, componentCallback = callback, // This key is required to ensure a new Component gets created for each different screen or payment session. // Generate a new value for this key every time you need to reset the Component. key = "UNIQUE_KEY_PER_COMPONENT", ) // This is your composable, a wrapper around our xml view. AdyenComponent( component = twintComponent, modifier = YOUR_MODIFIER, ) } ``` ### Tab: Without Jetpack Compose ```kotlin // Create the payment method object from the /paymentMethods response. val paymentMethod = paymentMethodsApiResponse?.paymentMethods.orEmpty().firstOrNull { it.type == PaymentMethodTypes.TWINT } val twintComponent = TwintComponent.PROVIDER.get( activity, // Your activity or fragment. paymentMethod, checkoutConfiguration, componentCallback, ) //Attach the Component to your view. binding.twintView.attach(twintComponent, activity) // Your activity or fragment. ``` ### Add Parameters Payments Request ## Add additional parameters to your /payments request You do not need to add any parameters to the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request when you [make a payment](/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Components#make-a-payment). ### Recurring ## Recurring payments To make recurring payments for TWINT, you need to: 1. [Create a shopper token](#create-a-token). 2. [Use the token to make future payments for the shopper](#make-payment-with-token). ### Create a token To create a token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: * `storePaymentMethod`: **true** * [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): Your unique identifier for the shopper (minimum length three characters). When the payment details have been stored, you receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) [webhook](/development-resources/webhooks) containing: * `type`: **recurring.token.created** * `shopperReference`: your unique identifier for the shopper. * `eventId`: the `pspReference` of the initial payment. * `storedPaymentMethodId`: the token that you need to make recurring payments for this shopper. Make sure that your server is able to receive the [Recurring tokens life cycle events](/development-resources/webhooks/webhook-types/#other-webhooks) webhook. You can [set up this webhook in your Customer Area](/development-resources/webhooks/#set-up-webhooks-in-your-customer-area). ### Make a payment with a token To make a payment with the token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: * `paymentMethod.storedPaymentMethodId`: The `storedPaymentMethodId` from the [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) webhook. You can also get this value using the [/listRecurringDetails](https://docs.adyen.com/api-explorer/Recurring/latest/post/listRecurringDetails) endpoint. * `shopperReference`: The unique shopper identifier that you specified when creating the token (minimum length three characters). * `shopperInteraction`: **ContAuth**. * `recurringProcessingModel`: **Subscription** or **UnscheduledCardOnFile**. For more information about the `shopperInteraction` and `recurringProcessingModel` fields, refer to [Tokenization](/online-payments/tokenization/). ## Test and go live Check the status of TWINT test payments in your [Customer Area](https://ca-test.adyen.com/) > **Transactions** > **Payments**. Before you can accept live TWINT payments, you need to [submit a request for TWINT](/payment-methods/add-payment-methods) in your [live Customer Area](https://ca-live.adyen.com/). ## Recurring payments To make recurring payments for TWINT, you need to: 1. [Create a shopper token](#create-a-token). 2. [Use the token to make future payments for the shopper](#make-payment-with-token). ### Create a token To create a token, include in your [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request: * `storePaymentMethod`: **true** * [shopperReference](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments#request-shopperReference): Your unique identifier for the shopper (minimum length three characters). When the payment details have been stored, you receive a [recurring.token.created](https://docs.adyen.com/api-explorer/Tokenization-webhooks/latest/post/recurring.token.created) [webhook](/development-resources/webhooks) containing: * `type`: **recurring.token.created** * `shopperReference`: your unique identifier for the shopper. * `eventId`: the `pspReference` of the initial payment. * `storedPaymentMethodId`: the token that you need to make recurring payments for this shopper. Make sure that your server is able to receive the [Recurring tokens life cycle events](/development-resources/webhooks/webhook-types/#other-webhooks) webhook. You can [set up this webhook in your Customer Area](/development-resources/webhooks/#set-up-webhooks-in-your-customer-area). ### Make a payment with a token Recurring payments can be made with Sessions or Advanced flow. ### Tab: Sessions flow When using Sessions flow, do the following: * Include the `storedPaymentMethodMode` and `shopperReference` parameter in your [/sessions](https://docs.adyen.com/api-explorer/Checkout/latest/post/sessions) request. * The API response will contain a list of the shopper's stored payment methods. * For drop-in, pass the API response as explained in the [integration guide](https://docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Android\&integration=Drop-in\&version=5.7.1#set-up) to show the stored payment methods. * For components, get the Twint `StoredPaymentMethod` from the list and pass it when creating the `TwintComponent`: **Create TwintComponent** ```java val storedPaymentMethods = checkoutSession.sessionSetupResponse.paymentMethodsApiResponse?.storedPaymentMethods val storedPaymentMethod = storedPaymentMethods?.firstOrNull { TwintComponent.PROVIDER.isPaymentMethodSupported(it) } val component = TwintComponent.PROVIDER.get( activity = activity, // or fragment = fragment checkoutSession = checkoutSession, storedPaymentMethod = storedPaymentMethod, configuration = checkoutConfiguration, componentCallback = callback, ) ``` ### Tab: Advanced flow When using Advanced flow, do the following: * When a shopper chooses to pay, they are provided with the option to store their payment details. To remove the option to store payment details with our [Tokenization feature](/online-payments/tokenization), add `setShowStorePaymentField`: **false** when configuring Twint. * The `PaymentComponentState` will contain the shopper's choice in `data.storePaymentMethod`. * Include `storePaymentMethod` and `shopperReference` in the [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request. * Include the `shopperReference` in the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) request and the response will contain a list of the shopper's stored payment methods. * For drop-in, pass the API response as explained in the [integration guide](https://docs.adyen.com/online-payments/build-your-integration/advanced-flow/?platform=Android\&integration=Drop-in\&version=5.7.1#set-up) to show the stored payment methods. * For components, get the Twint `StoredPaymentMethod` from the list and pass it when creating the `TwintComponent`: **Create TwintComponent** ```java val storedPaymentMethods = paymentMethodsApiResponse?.storedPaymentMethods val storedPaymentMethod = storedPaymentMethods?.firstOrNull { TwintComponent.PROVIDER.isPaymentMethodSupported(it) } val component = TwintComponent.PROVIDER.get( activity = activity, // or fragment = fragment storedPaymentMethod = storedPaymentMethod, configuration = checkoutConfiguration, componentCallback = callback, ) ```