alamantia / braintree_ios

Braintree SDK for iOS

Home Page:https://developers.braintreepayments.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Braintree iOS SDK

Carthage compatible Travis CI build status

Welcome to Braintree's iOS SDK. This library will help you accept card and alternative payments in your iOS app.

The Braintree iOS SDK requires Xcode 8+ and a Base SDK of iOS 9+. It permits a Deployment Target of iOS 7.0 or higher.

Getting Started

The current major version is 4.x. If you are upgrading from version 3.x, take a look at our Braintree iOS 3.x to 4.x Migration Guide.

We recommend using either CocoaPods or Carthage to integrate the Braintree SDK with your project.

CocoaPods

Add to your Podfile:

pod 'Braintree'

Then run pod install. This includes everything you need to accept card and PayPal payments. It also includes our Drop-in UI and payment button.

Customize your integration by specifying additional components. For example, add Apple Pay support:

pod 'Braintree'
pod 'Braintree/Apple-Pay'

You can also strip down your integration to only support credit and debit cards:

pod 'Braintree/Card'

See our Podspec for more information.

Although we recommend upgrading to the latest version of our SDK, you can choose to remain on the 3.x version, e.g.

pod 'Braintree', '~> 3.9'

Carthage

Add github "braintree/braintree_ios" to your Cartfile, and add the frameworks to your project.

Static Library

Please follow the static library integration instructions.

Manual Integration

For v3 integrations, please follow the v3 manual integration instructions.

Note that for apps targeting iOS 8+, you may add Braintree.xcodeproj to your Xcode workspace and add the frameworks to the app target Embedded Binaries section.

Supporting iOS 9

Support for iOS 9 requires a few configuration changes with your Xcode project, detailed below.

App Transport Security

iOS 9 introduces new security requirements and restrictions. If your app is compiled with iOS 9 SDK, it must comply with Apple's App Transport Security policy.

The Braintree Gateway domain complies with this policy.

3D Secure uses third party domains, which may need to be whitelisted for ATS, as part of the authentication process.

URL Query Scheme Whitelist

If your app is compiled with iOS 9 SDK and integrates payment options with an app-switch workflow, you must add URL schemes to the whitelist in your application's plist.

If your app supports payments from PayPal:

  • com.paypal.ppclient.touch.v1
  • com.paypal.ppclient.touch.v2

If your app supports payments from Venmo:

  • com.venmo.touch.v2

For example, if your app supports PayPal, you could add the following:

  <key>LSApplicationQueriesSchemes</key>
  <array>
    <string>com.paypal.ppclient.touch.v1</string>
    <string>com.paypal.ppclient.touch.v2</string>
  </array>

There is a new UIApplicationDelegate method that you may implement on iOS 9:

- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options

Implementing this method is optional. If you do not implement it, the deprecated equivalent will still be called; otherwise, it will not.

In either case, you still need to implement the deprecated equivalent in order to support iOS 8 or earlier:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation

Bitcode

The Braintree SDK works with apps that have bitcode enabled.

Documentation

Start with 'Hello, Client!' for instructions on basic setup and usage.

Next, read the full documentation for information about integration options, such as Drop-In UI, PayPal, and credit card tokenization.

Finally, cocoadocs.org/docsets/Braintree hosts the complete, up-to-date API documentation generated straight from the header files.

Demo

A demo app is included in project. To run it, run pod install and then open Braintree.xcworkspace in Xcode.

Help

Feedback

The Braintree iOS SDK is in active development, we welcome your feedback!

Here are a few ways to get in touch:

Releases

Subscribe to our Google Group to be notified when SDK releases go out.

License

The Braintree iOS SDK is open source and available under the MIT license. See the LICENSE file for more info.

About

Braintree SDK for iOS

https://developers.braintreepayments.com

License:MIT License


Languages

Language:Objective-C 80.4%Language:Swift 12.8%Language:C 5.6%Language:Ruby 1.1%Language:Shell 0.1%