BTDropInController

Objective-C

@interface BTDropInController
    : UIViewController <UIToolbarDelegate,
                        UIViewControllerTransitioningDelegate>

Swift

class BTDropInController : UIViewController, UIToolbarDelegate, UIViewControllerTransitioningDelegate

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

  • Initialize a new Drop-in view controller.

    Declaration

    Objective-C

    - (nullable instancetype)
        initWithAuthorization:(nonnull NSString *)authorization
                      request:(nonnull BTDropInRequest *)request
                      handler:(nullable BTDropInControllerHandler)handler;

    Swift

    init?(authorization: String, request: BTDropInRequest, handler: BTDropInControllerHandler? = nil)

    Parameters

    authorization

    A Braintree tokenization key, or a client token generated by your server. Passing an invalid value may return nil.

    handler

    A callback block that is invoked when tokenization has succeeded or failed.

    Return Value

    A Drop-in controller that is ready to be presented, or nil if authorization is invalid.

  • The API client used for communication with Braintree servers.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BTAPIClient *apiClient
  • The BTDropInRequest used to customize Drop-in

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) BTDropInRequest *_Nonnull dropInRequest;

    Swift

    var dropInRequest: BTDropInRequest { get }
  • Show the BTCardFormViewController

    Declaration

    Objective-C

    - (void)showCardForm:(nonnull id)sender;

    Swift

    func showCardForm(_ sender: Any)

    Parameters

    sender

    The sender requesting the view be changed.