BTCard
@objcMembers
public class BTCard : NSObject
The card tokenization request represents raw credit or debit card data provided by the customer. Its main purpose is to serve as the input for tokenization.
-
init(number:expirationMonth: expirationYear: cvv: postalCode: cardholderName: firstName: lastName: company: streetAddress: extendedAddress: locality: region: countryName: countryCodeAlpha2: countryCodeAlpha3: countryCodeNumeric: shouldValidate: authenticationInsightRequested: merchantAccountID: ) Creates a Card
Declaration
Swift
public convenience init( number: String, expirationMonth: String, expirationYear: String, cvv: String, postalCode: String? = nil, cardholderName: String? = nil, firstName: String? = nil, lastName: String? = nil, company: String? = nil, streetAddress: String? = nil, extendedAddress: String? = nil, locality: String? = nil, region: String? = nil, countryName: String? = nil, countryCodeAlpha2: String? = nil, countryCodeAlpha3: String? = nil, countryCodeNumeric: String? = nil, shouldValidate: Bool = false, authenticationInsightRequested: Bool = false, merchantAccountID: String? = nil )Parameters
numberRequired: The card number.
expirationMonthRequired: The expiration month as a one or two-digit number on the Gregorian calendar.
expirationYearRequired: The expiration year as a two or four-digit number on the Gregorian calendar.
cvvRequired: The card verification code (like CVV or CID).
postalCodeOptional: The postal code associated with the card’s billing address.
cardholderNameOptional: The cardholder’s name.
firstNameOptional: First name on the card.
lastNameOptional: Last name on the card.
companyOptional: Company name associated with the card.
streetAddressOptional: The street address associated with the card’s billing address.
extendedAddressOptional: The extended address associated with the card’s billing address.
localityOptional: The city associated with the card’s billing address.
regionOptional: Either a two-letter state code (for the US), or an ISO-3166-2 country subdivision code of up to three letters.
countryNameOptional: The country name associated with the card’s billing address.
countryCodeAlpha2Optional: The ISO 3166-1 alpha-2 country code specified in the card’s billing address.
countryCodeAlpha3Optional: The ISO 3166-1 alpha-3 country code specified in the card’s billing address.
countryCodeNumericOptional: The ISO 3166-1 numeric country code specified in the card’s billing address.
shouldValidateControls whether or not to return validations and/or verification results. By default, this is not enabled.
authenticationInsightRequestedOptional: If authentication insight is requested. If this property is set to
true, amerchantAccountIDmust be provided. Defaults tofalse.merchantAccountIDOptional: The merchant account ID.
-
Creates a
BTCardwith only expiration date and CVV, omitting the card number entirely. Use this when updating the expiry of a card already stored in your Vault, without re-sending the card number.Declaration
Swift
public convenience init(expirationMonth: String, expirationYear: String, cvv: String)Parameters
expirationMonthRequired: The expiration month as a one or two-digit number on the Gregorian calendar.
expirationYearRequired: The expiration year as a two or four-digit number on the Gregorian calendar.
cvvRequired: The card verification code (like CVV or CID).
-
Creates a new instance of
BTCardwith only a CVV value, setting default values for all other parameters. This initializer should only be used if you wish to create a CVV-only payment method nonce to verify a card already stored in your Vault.Declaration
Swift
public convenience init(cvv: String)Parameters
cvvThe card verification code (like CVV or CID).
-
init(cardholderName:firstName: lastName: company: postalCode: streetAddress: extendedAddress: locality: region: countryName: countryCodeAlpha2: countryCodeAlpha3: countryCodeNumeric: shouldValidate: authenticationInsightRequested: merchantAccountID: ) Creates a
BTCardwith only optional metadata fields, omitting card number, expiration date, and CVV. Use this when passing aBTCardtoCardFields, which manages those fields internally.Declaration
Swift
public convenience init( cardholderName: String? = nil, firstName: String? = nil, lastName: String? = nil, company: String? = nil, postalCode: String? = nil, streetAddress: String? = nil, extendedAddress: String? = nil, locality: String? = nil, region: String? = nil, countryName: String? = nil, countryCodeAlpha2: String? = nil, countryCodeAlpha3: String? = nil, countryCodeNumeric: String? = nil, shouldValidate: Bool = false, authenticationInsightRequested: Bool = false, merchantAccountID: String? = nil )
-
Returns a new
BTCardby merging the card number, expiration date, and CVV collected byCardFieldswith the metadata fields (e.g. cardholder name, billing address) from this instance.Warning
This method is intended for internal use byCardFieldsonly and is not part of the public merchant-facing API. Do not call this method directly.Declaration
Swift
public func merging( cardNumber: String, expirationMonth: String, expirationYear: String, cvv: String ) -> BTCard
View on GitHub