-
Creates a card client
Declaration
Swift
@objc(initWithAPIClient:) public init(apiClient: BTAPIClient)
Parameters
apiClient
An API client
-
Tokenizes a card
Declaration
Swift
@objc(tokenizeCard:completion:) public func tokenize(_ card: BTCard, completion: @escaping (BTCardNonce?, Error?) -> Void)
Parameters
card
The card to tokenize.
completion
A completion block that is invoked when card tokenization has completed. If tokenization succeeds,
tokenize
will contain a nonce anderror
will benil
; if it fails,tokenize
will benil
anderror
will describe the failure. -
tokenize(_:
Asynchronous) Tokenizes a card
Throws
AnError
describing the failureDeclaration
Swift
public func tokenize(_ card: BTCard) async throws -> BTCardNonce
Parameters
card
The card to tokenize.
Return Value
On success, you will receive an instance of
BTCardNonce