## Additional Configurations ## Overview The Ryft Android Drop-In SDK provides several **additional configuration** options that allow you to customize the payment experience according to your business needs. These configurations can be set when displaying the Drop-In UI. ## Customising the Drop-In UI You can customise the **title** of the *PAY* button in the Drop-In UI by providing a `payButtonTitle` parameter within the `display` component as shown below: Kotlin (Fragment) ```kotlin Customising Pay Button Title - Kotlin (Fragment) class CheckoutFragment : Fragment(), RyftDropInResultListener { private lateinit var ryftDropIn: RyftDropIn private lateinit var paymentButton: Button override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) ryftDropIn = DefaultRyftDropIn( fragment = this, listener = this ) } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) paymentButton = view.findViewById(R.id.button_payment) paymentButton.setOnClickListener { showDropIn() } } override fun onPaymentResult(result: RyftPaymentResult) { // TODO see next section } private fun showDropIn() { ryftDropIn.show( // Example for standard account payments RyftDropInConfiguration.standardAccountPayment( clientSecret = ""), googlePayConfiguration = RyftDropInGooglePayConfiguration( merchantName = "", merchantCountryCode = "" ), // Defaults to false if not provided fieldCollection = RyftDropInFieldCollectionConfiguration( nameOnCard = true ), display = RyftDropInDisplayConfiguration( usage = RyftDropInUsage.Payment, // or RyftDropInUsage.SetupCard payButtonTitle = null || "Pay" // Set as appropriate ) ) // Example for sub account payments // RyftDropInConfiguration.subAccountPayment( // clientSecret = ""), // subAccountId = ""), googlePayConfiguration = RyftDropInGooglePayConfiguration( merchantName = "", merchantCountryCode = "" ), // Defaults to false if not provided fieldCollection = RyftDropInFieldCollectionConfiguration( nameOnCard = true ), display = RyftDropInDisplayConfiguration( usage = RyftDropInUsage.Payment, // or RyftDropInUsage.SetupCard payButtonTitle = null || "Pay" // Set as appropriate ) ) // Example for sub account payments // RyftDropInConfiguration.subAccountPayment( // clientSecret = ""), // subAccountId = "", "" ), // Defaults to false if not provided new RyftDropInFieldCollectionConfiguration( true // nameOnCard ), new RyftDropInDisplayConfiguration( RyftDropInUsage.Payment, // or RyftDropInUsage.SetupCard null || "Pay" // Set as appropriate ), new RyftPublicApiKey("") ) // Example for sub account payments // RyftDropInConfiguration.subAccountPayment( // "", // "" // ), // // Defaults to false if not provided // new RyftDropInFieldCollectionConfiguration( // true // nameOnCard // ), // new RyftDropInDisplayConfiguration( // RyftDropInUsage.Payment, // or RyftDropInUsage.SetupCard // null || "Pay" // Set as appropriate // ), // new RyftPublicApiKey("") // ) ); } } ``` Java (Activity) ```java Customising Pay Button Title - Java (Activity) class CheckoutActivity extends ComponentActivity implements RyftDropInResultListener { private RyftDropIn ryftDropIn; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); ryftDropIn = new DefaultRyftDropIn(this, this); } @Override protected void onPaymentResult(final RyftPaymentResult result) { // TODO see next section } // Call this method when customer navigates to payment private void showDropIn() { ryftDropIn.show( // Example for standard account payments RyftDropInConfiguration.standardAccountPayment( "", "" ), // Defaults to false if not provided new RyftDropInFieldCollectionConfiguration( true // nameOnCard ), new RyftDropInDisplayConfiguration( RyftDropInUsage.Payment, // or RyftDropInUsage.SetupCard null || "Pay" // Set as appropriate ), new RyftPublicApiKey("") ) // Example for sub account payments // RyftDropInConfiguration.subAccountPayment( // "", // "" // ), // // Defaults to false if not provided // new RyftDropInFieldCollectionConfiguration( // true // nameOnCard // ), // new RyftDropInDisplayConfiguration( // RyftDropInUsage.Payment, // or RyftDropInUsage.SetupCard // null || "Pay" // Set as appropriate // ), // new RyftPublicApiKey("") // ) ); } } ``` ## Collecting Name on Card You can choose to collect the **Name on Card** field in the Drop-In UI when displaying the payment form. This can help with fraud prevention and improve payment success rates. To collect this field, you need to set the `nameOnCard` parameter to `true` within the `fieldCollection` configuration as shown below: Single Payment ```kotlin Collecting Name on Card - Single Payment RyftDropInConfiguration.standardAccountPayment( clientSecret = "", // The client secret returned when creating a Payment Session publicApiKey = RyftPublicApiKey(""), // Your Ryft Public API Key fieldCollection = RyftDropInFieldCollectionConfiguration( nameOnCard = true ) ) ``` Platform Fee Payment ```kotlin Collecting Name on Card - Platform Fee Payment 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 fieldCollection = RyftDropInFieldCollectionConfiguration( nameOnCard = true ) ) ``` ## Set-Up Cards for Future Payments You can allow customers to set up their cards for future payments directly from the Drop-In UI. This process is also known as **Zero-Value Authorisation**, and you can find more information on [this](/documentation/get_started/initiate_payments/additional_settings#account-verification-zero-value-authentication) page. The Android drop-in SDK has two main usage patterns: - `Payment` - used for customers actively making a payment. - `SetupCard` - used for customers who want to set up their card for future payments without making an immediate payment. By default, the Drop-In UI is configured for the `Payment` usage pattern. To change this to `SetupCard`, you need to specify the `usage` parameter in the `RyftDropInDisplayConfiguration` object when displaying the Drop-In UI, as shown below: Single Payment ```kotlin Setting Up Cards for Future Payments - Single Payment RyftDropInConfiguration.standardAccountPayment( clientSecret = "", // The client secret returned when creating a Payment Session publicApiKey = RyftPublicApiKey(""), // Your Ryft Public API Key display = RyftDropInDisplayConfiguration( usage = RyftDropInUsage.SetupCard // Set usage to SetupCard ) ) ``` Platform Fee Payment ```kotlin Setting Up Cards for Future Payments - Platform Fee Payment 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 display = RyftDropInDisplayConfiguration( usage = RyftDropInUsage.SetupCard // Set usage to SetupCard ) ) ```