dcaunt / braintree_ios

Braintree v.zero SDK for iOS - credit cards, One Touch PayPal + Venmo, Apple Pay

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Braintree v.zero SDK for iOS

Carthage compatible Travis CI build status

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

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

Screenshot of v.zero

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.

If you're looking to integrate version 4 and you need to accept payments with Venmo, please contact Braintree Support about joining the beta program for Pay with Venmo. If you are using Version 3 of the iOS SDK, it fully supports accepting payments via Venmo One Touch.

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

Coming soon: we will be offering a static library of the Braintree SDK.

Manual Integration

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

Complete v4 manual integration instructions are still in-progress. 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, custom payment button, 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

Braintree v.zero is in active development. We appreciate the time you take to try it out and welcome your feedback!

Here are a few ways to get in touch:

License

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

About

Braintree v.zero SDK for iOS - credit cards, One Touch PayPal + Venmo, Apple Pay

https://developers.braintreepayments.com

License:MIT License


Languages

Language:Objective-C 82.9%Language:Swift 10.2%Language:C 5.8%Language:Ruby 1.0%Language:Shell 0.1%Language:C++ 0.0%