Swiftpack.co - braintree/braintree_ios as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by braintree.
braintree/braintree_ios 6.0.0-beta2
Braintree SDK for iOS
⭐️ 524
🕓 7 weeks ago
.package(url: "https://github.com/braintree/braintree_ios.git", from: "6.0.0-beta2")

Braintree iOS SDK

CocoaPods compatible Swift Package Manager compatible Carthage compatible

GitHub Actions Tests

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

v6 is the latest major version of Braintree iOS and is currently in Beta. For stable releases, please point to v5 of the SDK. While preparing for general availability, we expect to make breaking changes in the beta releases. To update from v5, see the v6 migration guide.

The Braintree iOS SDK permits a deployment target of iOS 14.0 or higher. It requires Xcode 14+ and Swift 5.7+.

Supported Payment Methods


We recommend using Swift Package Manager, CocoaPods, or Carthage to integrate the Braintree SDK with your project.

Swift Package Manager

This feature is only available in v5+.

To add the Braintree package to your Xcode project, select File > Swift Packages > Add Package Dependency and enter https://github.com/braintree/braintree_ios as the repository URL. Tick the checkboxes for the specific Braintree libraries you wish to include.

If you look at your app target, you will see that the Braintree libraries you chose are automatically linked as a frameworks to your app (see General > Frameworks, Libraries, and Embedded Content).

BraintreePayPal and BraintreePaymentFlow also require the inclusion of the PayPalDataCollector module.

In your app's source code files, use the following import syntax to include Braintree's libraries:

import BraintreeCore
import BraintreeCard
import BraintreeApplePay
import BraintreePayPal


# Includes Cards and PayPal
pod 'Braintree'

# Optionally include additional Pods
pod 'Braintree/DataCollector'
pod 'Braintree/Venmo'


Braintree 6.0.0+ requires Carthage 0.38.0+ and the --use-xcframeworks option when running carthage update.

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

Note: Long term support for Carthage is not guaranteed. Please update to SPM, if possible. If there are concerns, please comment on this Discussion thread.


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

Next, read the full documentation for information about integrating with additional payment methods, such as PayPal and Venmo, as well as explore our pre-built Drop-In UI offering.


This SDK abides by our Client SDK Deprecation Policy. For more information on the potential statuses of an SDK check our developer docs.

Major version number Status Released Deprecated Unsupported
6.x.x Beta TBA TBA TBA
5.x.x Active February 2021 TBA TBA
4.x.x Unsupported November 2015 February 2022 February 2023

Versions 4.9.6 and below use outdated SSL certificates and are unsupported.


A demo app is included in the project. To run it you will need to do the following:

  1. Run pod install
    • There is a known M1 mac issue with CocoaPods. See this solution to resolve ffi dependency issues.
  2. Resolve the Swift Package Manager packages if needed: File > Packages > Resolve Package Versions or by running swift package resolve in Terminal
  3. Open Braintree.xcworkspace in Xcode
  4. Select the Demo scheme, and then run

Xcode 14+ is required to run the demo app.


We welcome PRs to this repo. See our development doc.


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

Here are a few ways to get in touch:



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


Stars: 524
Last commit: 1 hour ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1 week ago
  • Add missed deprecation warnings to BTCardRequest Union Pay properties
  • Update Cardinal SDK to version 2.2.5-6
  • BraintreePayPalNativeCheckout (BETA)
    • Expose payerID property on BTPayPalNativeCheckoutAccountNonce publicly
    • Expose all properties on BTPayPalNativeCheckoutAccountNonce to Objective-C

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics