The Ryft iOS Drop-In SDK provides several additional configuration options that allow you to customise the payment experience further.
These configurations can help you tailor the Drop-In UI to better fit your application's needs and enhance the user experience.
You can customise the appearance of the Drop-In UI by passing in your own RyftUITheme instance when initialising the Drop-In SDK. This allows you to modify colors, fonts, and other visual elements to match your app's branding.
Here's an example of how to apply a custom theme to the Ryft Drop-In SDK:
let myTheme = RyftUITheme.defaultTheme
myTheme.separatorLineColor = .blue
// set various other colors
ryftDropIn = RyftDropInPaymentViewController(...)
ryftDropIn.theme = myTheme
present(ryftDropIn, animated: true, completion: nil)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 enable this option, supply the fieldCollection object with nameOnCard: true when creating the RyftDropInConfiguration instance, as shown below:
RyftDropInConfiguration(
clientSecret: "<the client secret of the payment-session>",
accountId: "nil | <the Id of the sub-account you are taking payments for>",
fieldCollection: RyftDropInConfiguration.RyftDropInFieldCollectionConfig(
nameOnCard: true
)
)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 page.
The iOS 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 RyftDropInConfiguration object when displaying the Drop-In UI, as shown below:
ryftDropIn = RyftDropInPaymentViewController(
config: RyftDropInConfiguration(
clientSecret: "<the client secret of the payment-session>",
usage: .setupCard // Set usage to setupCard
),
publicApiKey: "<your public API key>",
delegate: self
)
present(ryftDropIn, animated: true, completion: nil)