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

#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"
[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.


See BraintreeCard framework header files for in-depth documentation.

Next Page: Server-side →