Display a saved payment method

If you pass a customer_id when generating a client token, Drop-in will display that customer's saved payment methods and automatically add any newly-entered payment methods to their Vault record.

note

Apple Pay will not be automatically vaulted on the client.

Delete a saved payment method

If you authorize Drop-in using client tokens generated with customer_ids, you can also enable customers to remove saved payment methods from their Vault records. To support this functionality, enable Drop-in's Vault Manager:

BTDropInRequest *request = [[BTDropInRequest alloc] init];
request.vaultManager = YES;

Drop-in will then display an edit button which launches the Vault Manager.

important

We do not recommend enabling Vault Manager if you are using Braintree's recurring billing; doing so would give your customers the ability to delete payment methods associated with subscriptions.

Collect cardholder name

You can collect the cardholder name as part of the credit card form. This field can be marked as optional or required.

BTDropInRequest *request = [[BTDropInRequest alloc] init];
request.cardholderNameSetting = BTFormFieldOptional;
// To make the field required
// request.cardholderNameSetting = BTFormFieldRequired;

Advanced Fraud Management Tools

To use Advanced Fraud Management Tools for your Drop-in form, you'll need to complete these 3 steps at the same time:

  1. Enable Advanced Fraud Management Tools in the Control Panel
  2. Update your client-side integration to collect device data
  3. Update your server-side integration to pass device data on transaction and verification requests

If there is any delay between enabling in the Control Panel and making the code changes, the integration will not work properly. See the Advanced Fraud Management Tools guide for more details.

note

If you choose to automatically vault a customer's new payment method, verifications for those payment methods will not include device data when they are evaluated by our Advanced Fraud Management Tools. Subsequent transactions can still pass device data.

Color schemes

Drop-in is fully customizable, but we also provide Light, Dark, and Dynamic color schemes. The dynamic color scheme will switch between light and dark based on whether the device is in light or dark mode. The Dynamic scheme is only available in iOS 13+. Drop-in will use the Light color scheme by default.

// Set the theme before initializing Drop-in
BTUIKAppearance.sharedInstance.colorScheme = BTUIKColorSchemeDynamic;

Appearance

Use BTUIKAppearance to customize the appearance of Drop-in and other BraintreeUIKit classes. Be sure to call these methods before initializing Drop-in. View the list of customizable properties.

[BTUIKAppearance sharedInstance].primaryTextColor = [UIColor greenColor];

You can also customize Drop-in to utilize your own dynamic colors using Apple's init(dynamicProvider: @escaping (UITraitCollection) -> UIColor).