Advanced Client-Side Implementation

Get the SDKAnchorIcon

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 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.