Supporting app switch

Accepting payments

Previously in 3.x, BTPaymentProvider was a centralized provider of BTPaymentMethod objects for each payment option. In 4.0, this has been re-architected so that each payment option has its own class responsible for tokenizing payment methods.

These classes are called drivers when they involve some UI interaction, or clients when they are headless:

Payment option clients and drivers use block-based APIs to return BTPaymentMethodNonce instances that have a nonce property.

Drivers have a required viewControllerPresentingDelegate property, which should be set to your view controller, which is responsible for modally presenting and dismissing the view controllers required to finalize payments.

See each class's header file for more information.

Other changes

Tokenization keys

BTAPIClient can also be initialized with a tokenization key, which is a static Braintree API key that is specified at compile-time. Tokenization keys support a subset of the client token's capabilities, but they have the advantage of allowing you to start interacting with our services without the overhead of a network call to generate a client token.

Project reorganization

The components of the Braintree iOS SDK have been renamed, and each component has an umbrella header that imports the publicly available classes for that component: