Advanced Client-Side Implementation
Use Advanced client-side if you need more direct control over card inputs, formatting, validation, or tokenization behavior that Card Fields doesn't cover.
Card Fields is recommended for merchants who want SDK-managed card entry while keeping control over the rest of checkout. Advanced client-side is intended for merchants with custom requirements who need to directly manage more of the card entry flow.
If you don't need that level of control, use Standard client-side to integrate Card Fields instead.
The SSL certificates for Braintree Mobile (iOS and Android) SDKs are set to expire on March 30, 2026. This will impact existing versions of the SDK in published versions of your app. To reduce the impact, upgrade the iOS SDK to version 7.0.0+ for the new SSL certifications.
If you do not decommission your app versions that include the older SDK versions or force upgrade your app with the updated certificates by the expiration date, 100% of your customer traffic will fail.Get the SDK
CocoaPods
Include Braintree in your podfile:
- Ruby
pod 'Braintree'Swift Package Manager
Include the BraintreeCard framework.
Carthage
Include the BraintreeCore and BraintreeCard framework.
Initialization
To use our card payment processing with your own UI, instantiate a BTCardClient and tokenize the card details.
- Swift
// For client authorization,
// get your tokenization key from the Control Panel
// or fetch a client token
let cardClient = BTCardClient(authorization: "<#CLIENT_AUTHORIZATION#>")
let card = BTCard(
number: "4111111111111111",
expirationMonth: "12",
expirationYear: "2025"
)
cardClient.tokenize(card) { tokenizedCard, error in
// Communicate the tokenizedCard.nonce to your server, or handle error
}In the completion block, send the resulting nonce to your server for use.
See the reference docs for in-depth documentation.