Classes

The following classes are available globally.

  • The primary UIViewController for Drop-In. BTDropInController will manage the other UIViewControllers and return a BTDropInResult.

    See more

    Declaration

    Objective-C

    @interface BTDropInController
        : UIViewController <UIToolbarDelegate,
                            UIViewControllerTransitioningDelegate>

    Swift

    class BTDropInController : UIViewController, UIToolbarDelegate, UIViewControllerTransitioningDelegate
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTDropInLocalization : NSObject
    
    /// Sets custom translation locales for the Drop-In UI
    ///
    /// @param locales An array of locale codes
    + (void)setCustomTranslations:(NSArray<NSString *> *)locales;
    
    @end

    Swift

    class BTDropInLocalization : NSObject
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTDropInRequest : NSObject <NSCopying>
    
    /// Optional: Specify the options for the PayPal flow using either BTPayPalCheckoutRequest or BTPayPalVaultRequest. If not present, a default vault flow will be used.
    @property (nonatomic, strong, nullable) BTPayPalRequest *payPalRequest;
    
    /// Optional: Specify the options for the Venmo flow. If not present, a default vault flow will be used.
    @property (nonatomic, strong, nullable) BTVenmoRequest *venmoRequest;
    
    /// Optional: Use this parameter to disable Apple Pay. Otherwise if Apple Pay is correctly configured, Apple Pay will appear as a selection in the Payment Method options.
    @property (nonatomic, assign) BOOL applePayDisabled;
    
    /// Defaults to false. Set to true to hide the PayPal option even if enabled for your account.
    @property (nonatomic, assign) BOOL paypalDisabled;
    
    /// Defaults to false. Set to true to hide the Venmo option even if enabled for your account.
    @property (nonatomic, assign) BOOL venmoDisabled;
    
    /// Defaults to false. Set to true to hide the Card option even if enabled for your account.
    @property (nonatomic, assign) BOOL cardDisabled;
    
    /// Defaults to false. Set to true to hide all card logos for your account.
    @property (nonatomic, assign) BOOL cardLogosDisabled;
    
    /// Optional: Enable 3DS verification and specify options and additional information.
    ///
    /// Note: To encourage 3DS 2.0 flows, set `billingAddress`, `amount`, `email`, `mobilePhone` for best results.
    @property (nonatomic, strong, nullable) BTThreeDSecureRequest *threeDSecureRequest;
    
    /// Optional: Determines the visibility and input requirements of the cardholder name field.
    ///
    /// When set to BTFormFieldDisabled, the cardholder name field will not be displayed.
    /// When set to BTFormFieldOptional, the cardholder name field will be displayed but not required.
    /// When set to BTFormFieldRequired, the cardholder name field will be displayed and required.
    ///
    /// Defaults to BTFormFieldDisabled.
    @property (nonatomic, assign) BTFormFieldSetting cardholderNameSetting;
    
    /// Optional: If true the security code will be masked.
    /// Defaults to false.
    @property (nonatomic, assign) BOOL shouldMaskSecurityCode;
    
    /// Optional: If true, enables the managment UI.
    /// Defaults to false.
    @property (nonatomic, assign) BOOL vaultManager;
    
    /// Optional: Whether or not to vault the card upon tokenization, can only be applied when initializing the Braintree client with a client token that was generated with a customer ID. When set to `false` with `allowVaultCardOverride` set to `false`, then cards will not be vaulted.
    /// Defaults to true
    @property (nonatomic, assign) BOOL vaultCard;
    
    /// Optional: When true, the card form will include an option to let the customer decide not to vault the card.
    /// Defaults to false
    @property (nonatomic, assign) BOOL allowVaultCardOverride;
    
    /// Optional: Customization options for Braintree Drop-in's user interface.
    @property (nonatomic, strong, nullable) BTDropInUICustomization *uiCustomization;
    
    @end

    Swift

    class BTDropInRequest : NSObject, NSCopying
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface BTDropInResult : NSObject
    
    /// True if the modal was dismissed without selecting a payment method
    @property (nonatomic, assign, getter=isCanceled) BOOL canceled;
    
    /// The type of the payment option
    @property (nonatomic, assign) BTDropInPaymentMethodType paymentMethodType;
    
    /// A UIView (BTUIKPaymentOptionCardView) that represents the payment option
    @property (nonatomic, readonly) UIView *paymentIcon;
    
    /**
     * A description of the payment option.
     * For cards, the last four digits of the card number.
     * For PayPal, the email address associated with the account.
     * For Venmo, the username associated with the account.
     * For Apple Pay, the text "Apple Pay".
     */
    @property (nonatomic, readonly) NSString *paymentDescription;
    
    /// The payment method nonce
    @property (nonatomic, strong, nullable) BTPaymentMethodNonce *paymentMethod;
    
    /**
     * A `deviceData` string that represents data about a customer's device. This is generated from Braintree's advanced fraud protection service.
     *
     * `deviceData` should be passed into server-side calls, such as `Transaction.sale`. This enables you to collect data about a customer's device and correlate it with a session identifier on your server.
     *
     * Collecting and passing this data with transactions helps reduce decline rates and detect fraudulent transactions.
     */
    @property (nonatomic, strong, nullable) NSString *deviceData;
    
    /**
     * Fetch a `BTDropInResult` with the customer's vaulted payment method.
     * The payment method returned is not guaranteed to be the most recently added payment method.
     * If the vaulted payment method is Apple Pay, a `BTDropInResult` with
     * `paymentMethodType == .applePay` will be returned in the completion block.
     *
     * @param clientToken Client token. Must be generated with a customer ID.
     * @param completion The completion block, which passes back a result or an error. Both result and error may be nil if the customer does not have any vaulted payment methods.
     */
     // NEXT_MAJOR_VERSION: - update this function name to more accurately represent the behavior of the function
    + (void)mostRecentPaymentMethodForClientToken:(NSString *)clientToken
                                       completion:(void (^)(BTDropInResult * _Nullable result, NSError * _Nullable error))completion;
    
    @end

    Swift

    class BTDropInResult : NSObject
  • Options for customizing Braintree Drop-in’s user interface.

    See more

    Declaration

    Objective-C

    @interface BTDropInUICustomization : NSObject

    Swift

    class BTDropInUICustomization : NSObject