# Showing the Drop-in UI ## Overview Once you have initialised the Ryft Drop-In SDK, as indicated in the [initial setup](/documentation/get_started/process_payments/android/initial_setup), you can show the Drop-In payment UI to your users. ## Displaying the Drop-In UI In order to display the Drop-In UI, you can call the `show()` method on the `RyftDropIn` instance you created during the initialisation step. This will include passing the necessary configuration parameters required for the payment process, such as: - Your **Public Key**; - The **Client Secret** obtained from your backend when creating a Payment Session; - (Optional) The **Account ID** if you are processing payments on behalf of a Sub-Account. Here's an example of how to show the Drop-In UI in your activity or fragment: Single Payment ```kotlin Showing the Ryft Android Drop-In UI - Single Payment class CheckoutActivity : ComponentActivity() { // ... private lateinit var payButton: Button // Example pay button // ... override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // ... payButton.setOnClickListener { showDropIn() } // ... } // ... private fun showDropIn() { ryftDropIn.show( RyftDropInConfiguration.standardAccountPayment( clientSecret = "", // The client secret returned when creating a Payment Session publicApiKey = RyftPublicApiKey("") // Your Ryft Public API Key ), ) } // ... } ``` Platform Fee Payment ```kotlin Showing the Ryft Android Drop-In UI - Platform Fee Payment class CheckoutActivity : ComponentActivity() { // ... // Example pay button private lateinit var payButton: Button // ... override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // ... payButton.setOnClickListener { showDropIn() } // ... } // ... private fun showDropIn() { ryftDropIn.show( RyftDropInConfiguration.subAccountPayment( clientSecret = "", // The client secret returned when creating a Payment Session publicApiKey = RyftPublicApiKey(""), // Your Ryft Public API Key subAccountId = "" // The Id of the Sub-Account you are taking payments for ), ) } // ... } ``` The Drop-In will automatically detect the appropriate environment (test or live) based on the provided Public Key. ## Add Google Pay To enable **Google Pay** in the Drop-In UI, you need to ensure that: - You have provided a **RyftDropInGooglePayConfiguration** object when displaying the Drop-In UI. - The user has a valid Google Pay method set up on their device. Google Pay will be disabled in the Drop-In UI if the above conditions are not met. Here's an example of how to enable Google Pay in the Drop-In UI: Single Payment ```kotlin Enabling Google Pay in Ryft Android Drop-In UI - Single Payment private fun showDropIn() { ryftDropIn.show( RyftDropInConfiguration.standardAccountPayment( // ... googlePayConfiguration = RyftDropInGooglePayConfiguration( merchantName = "", // The name of your business as it should appear in Google Pay merchantCountryCode = "" // The ISO 3166-1 alpha-2 country code of your business (e.g., "UK") ) ), ) } ``` Platform Fee Payment ```kotlin Enabling Google Pay in Ryft Android Drop-In UI - Platform Fee Payment private fun showDropIn() { ryftDropIn.show( RyftDropInConfiguration.subAccountPayment( // ... googlePayConfiguration = RyftDropInGooglePayConfiguration( merchantName = "", // The name of your business as it should appear in Google Pay merchantCountryCode = "" // The ISO 3166-1 alpha-2 country code of your business (e.g., "UK") ) ), ) } ``` With this setup, Google Pay will be available as a payment option in the Drop-In UI, provided the user has it configured on their device. ## Next Steps After displaying the Drop-In UI, you will need to handle the payment result. This is done by implementing the `RyftDropInResultListener` interface in your activity or fragment. For more information on how to implement the listener and handle payment results, please refer to the [Drop-In Listener](/documentation/get_started/process_payments/android/drop_in_listener) section.