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.

Initializer

  • Creates a Card

    Declaration

    Swift

    public 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

    number

    Required: The card number.

    expirationMonth

    Required: The expiration month as a one or two-digit number on the Gregorian calendar.

    expirationYear

    Required: The expiration year as a two or four-digit number on the Gregorian calendar.

    cvv

    Required: The card verification code (like CVV or CID).

    postalCode

    Optional: The postal code associated with the card’s billing address.

    cardholderName

    Optional: The cardholder’s name.

    firstName

    Optional: First name on the card.

    lastName

    Optional: Last name on the card.

    company

    Optional: Company name associated with the card.

    streetAddress

    Optional: The street address associated with the card’s billing address.

    extendedAddress

    Optional: The extended address associated with the card’s billing address.

    locality

    Optional: The city associated with the card’s billing address.

    region

    Optional: Either a two-letter state code (for the US), or an ISO-3166-2 country subdivision code of up to three letters.

    countryName

    Optional: The country name associated with the card’s billing address.

    countryCodeAlpha2

    Optional: The ISO 3166-1 alpha-2 country code specified in the card’s billing address.

    countryCodeAlpha3

    Optional: The ISO 3166-1 alpha-3 country code specified in the card’s billing address.

    countryCodeNumeric

    Optional: The ISO 3166-1 numeric country code specified in the card’s billing address.

    shouldValidate

    Controls whether or not to return validations and/or verification results. By default, this is not enabled.

    authenticationInsightRequested

    Optional: If authentication insight is requested. If this property is set to true, a merchantAccountID must be provided. Defaults to false.

    merchantAccountID

    Optional: The merchant account ID.

  • Creates a new instance of BTCard with 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

    cvv

    The card verification code (like CVV or CID).