To use Braintree card payment processing with your own UI, instantiate a BTCardClient and tokenize the card details.

Objective-C Swift
#import "BraintreeCard.h"

// For client authorization, 
// get your tokenization key from the control panel
// or fetch a client token
BTAPIClient *braintreeClient = [[BTAPIClient alloc] initWithAuthorization:@"<#CLIENT_AUTHORIZATION#>"];
BTCardClient *cardClient = [[BTCardClient alloc] initWithAPIClient:braintreeClient];
BTCard *card = [[BTCard alloc] initWithNumber:@"4111111111111111"
                              expirationMonth:@"12"
                               expirationYear:@"2018"
                                          cvv:nil];
[cardClient tokenizeCard:card
              completion:^(BTCardNonce *tokenizedCard, NSError *error) {
    // 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 BraintreeCard framework header files for in-depth documentation.

Next: Server-side →

Still have questions?

If you can’t find an answer, contact our Support team.