CardToken constructor

const CardToken({
  1. required String id,
  2. @Default("card") String object,
  3. @JsonKey(name: "address_city") String? addressCity,
  4. @JsonKey(name: "address_country") String? addressCountry,
  5. @JsonKey(name: "address_line1") String? addressLine1,
  6. @JsonKey(name: "address_line1_check") VerificationCheck? addressLine1Check,
  7. @JsonKey(name: "address_line2") String? addressLine2,
  8. @JsonKey(name: "address_state") String? addressState,
  9. @JsonKey(name: "address_zip") String? addressZip,
  10. @JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck,
  11. @Default(CardTokenBrand.unknown) CardTokenBrand? brand,
  12. String? country,
  13. String? currency,
  14. @JsonKey(name: "cvc_check") VerificationCheck? cvcCheck,
  15. @JsonKey(name: "dynamic_last4") String? dynamicLast4,
  16. @JsonKey(name: "exp_month") int? expMonth,
  17. @JsonKey(name: "exp_year") int? expYear,
  18. String? fingerprint,
  19. CardFundingType? funding,
  20. String? last4,
  21. @Default({}) Map<String, dynamic> metadata,
  22. String? name,
  23. @JsonKey(name: "tokenization_method") CardTokenizationMethod? tokenizationMethod,
})

Implementation

const factory CardToken({
  /// Unique identifier for the object.
  required String id,

  /// String representing the object’s type.
  /// Objects of the same type share the same value.
  /// Value is "card".
  @Default("card") String object,

  /// City/District/Suburb/Town/Village.
  @JsonKey(name: "address_city") String? addressCity,

  /// Billing address country, if provided when creating card.
  @JsonKey(name: "address_country") String? addressCountry,

  /// Address line 1 (Street address/PO Box/Company name).
  @JsonKey(name: "address_line1") String? addressLine1,

  /// If address_line1 was provided, results of the check:
  /// pass, fail, unavailable, or unchecked.
  @JsonKey(name: "address_line1_check") VerificationCheck? addressLine1Check,

  /// Address line 2 (Apartment/Suite/Unit/Building).
  @JsonKey(name: "address_line2") String? addressLine2,

  /// State/County/Province/Region.
  @JsonKey(name: "address_state") String? addressState,

  /// ZIP or postal code.
  @JsonKey(name: "address_zip") String? addressZip,

  /// If address_zip was provided, results of the check:
  /// pass, fail, unavailable, or unchecked.
  @JsonKey(name: "address_zip_check") VerificationCheck? addressZipCheck,

  /// If address_zip was provided, results of the check:
  /// pass, fail, unavailable, or unchecked.
  @Default(CardTokenBrand.unknown) CardTokenBrand? brand,

  /// Two-letter ISO code representing the country of the card.
  /// You could use this attribute to get a sense of the
  /// international breakdown of cards you’ve collected.
  String? country,

  /// Three-letter ISO currency code, in lowercase.
  /// Must be a supported currency.
  String? currency,

  /// If a CVC was provided, results of the check:
  /// pass, fail, unavailable, or unchecked.
  /// A result of unchecked indicates that CVC was provided but hasn’t
  /// been checked yet.
  /// Checks are typically performed when attaching a card to a Customer
  /// object, or when creating a charge. For more details, see
  /// Check if a card is valid without a charge.
  /// https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge
  @JsonKey(name: "cvc_check") VerificationCheck? cvcCheck,

  /// (For tokenized numbers only.)
  /// The last four digits of the device account number.
  @JsonKey(name: "dynamic_last4") String? dynamicLast4,

  /// Two-digit number representing the card’s expiration month.
  @JsonKey(name: "exp_month") int? expMonth,

  /// Four-digit number representing the card’s expiration year.
  @JsonKey(name: "exp_year") int? expYear,

  /// Uniquely identifies this particular card number.
  /// You can use this attribute to check whether two customers who’ve
  /// signed up with you are using the same card number, for example.
  /// For payment methods that tokenize card information
  /// (Apple Pay, Google Pay), the tokenized number might be provided
  /// instead of the underlying card number.
  /// Starting May 1, 2021, card fingerprint in India for Connect will
  /// change to allow two fingerprints for the same card — one for India and
  /// one for the rest of the world.
  String? fingerprint,

  /// Card funding type. Can be credit, debit, prepaid, or unknown.
  CardFundingType? funding,

  /// The last four digits of the card.
  String? last4,

  /// Set of key-value pairs that you can attach to an object.
  /// This can be useful for storing additional information about the object
  /// in a structured forma
  @Default({}) Map<String, dynamic> metadata,

  /// Cardholder name.
  String? name,

  /// If the card number is tokenized, this is the method that was used.
  /// Can be android_pay (includes Google Pay), apple_pay, masterpass,
  /// visa_checkout, or null.
  @JsonKey(name: "tokenization_method")
  CardTokenizationMethod? tokenizationMethod,
}) = _CardToken;