Credit Cards

Client-Side Implementation

Important
The SSL certificates for all Braintree SDKs are set to expire by June 30, 2025. This will impact existing versions of the SDK in published versions of your app. To reduce the impact, upgrade the iOS SDK to version 6.17.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 SDKAnchorIcon

CocoaPodsAnchorIcon

Include Braintree in your podfile:
  1. Ruby
pod 'Braintree'

Swift Package ManagerAnchorIcon

Include the BraintreeCard framework.

CarthageAnchorIcon

Include the BraintreeCore and BraintreeCard framework.

InitializationAnchorIcon

To use our card payment processing with your own UI, instantiate a BTCardClient and tokenize the card details.
  1. Swift
// For client authorization,
// get your tokenization key from the Control Panel
// or fetch a client token
let braintreeClient = BTAPIClient(authorization: "<#CLIENT_AUTHORIZATION#>")!
let cardClient = BTCardClient(apiClient: braintreeClient)
let card = BTCard()
card.number = "4111111111111111"
card.expirationMonth = "12"
card.expirationYear = "2025"
cardClient.tokenizeCard(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.
Note
See the reference docs for in-depth documentation.

If you accept cookies, we’ll use them to improve and customize your experience and enable our partners to show you personalized PayPal ads when you visit other sites. Manage cookies and learn more