Skip to content

bytemarkinc/braintree_ios

 
 

Repository files navigation

Braintree v.zero SDK for iOS

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

Screenshot of v.zero

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. See the README for more details.

Special note on preprocessor macros

Apple Pay is a build option. To include Apple Pay support in your build, use the Apple-Pay subspec in your Podfile:

pod "Braintree"
pod "Braintree/Apple-Pay"

Then ensure BT_ENABLE_APPLE_PAY=1 is present in your target's "Preprocessor Macros" settings. By default, this should happen automatically if you have a Preprocessor Macro entry for $(inherited).

Updating for iOS 9

Xcode 7 is required.

Supporting Bitcode

The Braintree SDK works with apps that have bitcode enabled.

However, if your integration uses BTData for fraud detection, it does not currently support having bitcode enabled. We are working to add support for this shortly.

App Transport Security

iOS 9 introduces new security requirements and restrictions that can impact the behavior of the Braintree SDK. If your app is compiled with iOS 9 SDK, it must comply with Apple's App Transport Security policy.

Please whitelist the Braintree Gateway domain by adding the following to your application's plist:

  <key>NSAppTransportSecurity</key>
  <dict>
    <key>NSExceptionDomains</key>
    <dict>
      <key>api.braintreegateway.com</key>
      <dict>
          <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
          <false/>
      </dict>
    </dict>
  </dict>

If your app uses BTData, also include the following under NSExceptionDomains:

  <key>kaptcha.com</key>
    <dict>
      <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
      <false/>
      <key>NSIncludesSubdomains</key>
      <true/>
      <key>NSTemporaryExceptionMinimumTLSVersion</key>
      <string>TLSv1.0</string>
  </dict>

We are actively working to update the SSL certificates of these servers so that your app will not require these exceptions in the near future.

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
  • org-appextension-feature-password-management

If your app supports payments from Venmo:

  • com.venmo.touch.v1

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

  <key>LSApplicationQueriesSchemes</key>
  <array>
    <string>com.venmo.touch.v1</string>
    <string>com.paypal.ppclient.touch.v1</string>
    <string>com.paypal.ppclient.touch.v2</string>
    <string>org-appextension-feature-password-management</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

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.8%
  • Ruby 1.1%
  • Other 0.1%