BTCard.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #import <Foundation/Foundation.h>
  2. NS_ASSUME_NONNULL_BEGIN
  3. /**
  4. 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.
  5. */
  6. @interface BTCard : NSObject
  7. /**
  8. A convenience initializer for creating a card tokenization request.
  9. */
  10. - (instancetype)initWithNumber:(NSString *)number
  11. expirationMonth:(NSString *)expirationMonth
  12. expirationYear:(NSString *)expirationYear
  13. cvv:(nullable NSString *)cvv;
  14. /**
  15. Designated initializer.
  16. */
  17. - (instancetype)initWithParameters:(NSDictionary *)parameters NS_DESIGNATED_INITIALIZER;
  18. /**
  19. The card number
  20. */
  21. @property (nonatomic, nullable, copy) NSString *number;
  22. /**
  23. The expiration month as a one or two-digit number on the Gregorian calendar
  24. */
  25. @property (nonatomic, nullable, copy) NSString *expirationMonth;
  26. /**
  27. The expiration year as a two or four-digit number on the Gregorian calendar
  28. */
  29. @property (nonatomic, nullable, copy) NSString *expirationYear;
  30. /**
  31. The card verification code (like CVV or CID).
  32. @note If you wish to create a CVV-only payment method nonce to verify a card already stored in your Vault, omit all other properties to only collect CVV.
  33. */
  34. @property (nonatomic, nullable, copy) NSString *cvv;
  35. /**
  36. The postal code associated with the card's billing address
  37. */
  38. @property (nonatomic, nullable, copy) NSString *postalCode;
  39. /**
  40. Optional: the cardholder's name.
  41. */
  42. @property (nonatomic, nullable, copy) NSString *cardholderName;
  43. /**
  44. Optional: first name on the card.
  45. */
  46. @property (nonatomic, nullable, copy) NSString *firstName;
  47. /**
  48. Optional: last name on the card.
  49. */
  50. @property (nonatomic, nullable, copy) NSString *lastName;
  51. /**
  52. Optional: company name associated with the card.
  53. */
  54. @property (nonatomic, nullable, copy) NSString *company;
  55. /**
  56. Optional: the street address associated with the card's billing address
  57. */
  58. @property (nonatomic, nullable, copy) NSString *streetAddress;
  59. /**
  60. Optional: the extended address associated with the card's billing address
  61. */
  62. @property (nonatomic, nullable, copy) NSString *extendedAddress;
  63. /**
  64. Optional: the city associated with the card's billing address
  65. */
  66. @property (nonatomic, nullable, copy) NSString *locality;
  67. /**
  68. Optional: the state/province associated with the card's billing address
  69. */
  70. @property (nonatomic, nullable, copy) NSString *region;
  71. /**
  72. Optional: the country name associated with the card's billing address.
  73. @note Braintree only accepts specific country names.
  74. @see https://developers.braintreepayments.com/reference/general/countries#list-of-countries
  75. */
  76. @property (nonatomic, nullable, copy) NSString *countryName;
  77. /**
  78. Optional: the ISO 3166-1 alpha-2 country code specified in the card's billing address.
  79. @note Braintree only accepts specific alpha-2 values.
  80. @see https://developers.braintreepayments.com/reference/general/countries#list-of-countries
  81. */
  82. @property (nonatomic, nullable, copy) NSString *countryCodeAlpha2;
  83. /**
  84. Optional: The ISO 3166-1 alpha-3 country code specified in the card's billing address.
  85. @note Braintree only accepts specific alpha-3 values.
  86. @see https://developers.braintreepayments.com/reference/general/countries#list-of-countries
  87. */
  88. @property (nonatomic, nullable, copy) NSString *countryCodeAlpha3;
  89. /**
  90. Optional: The ISO 3166-1 numeric country code specified in the card's billing address.
  91. @note Braintree only accepts specific numeric values.
  92. @see https://developers.braintreepayments.com/reference/general/countries#list-of-countries
  93. */
  94. @property (nonatomic, nullable, copy) NSString *countryCodeNumeric;
  95. /**
  96. Controls whether or not to return validations and/or verification results. By default, this is not enabled.
  97. @note Use this flag with caution. By enabling client-side validation, certain tokenize card requests may result in adding the card to the vault. These semantics are not currently documented.
  98. */
  99. @property (nonatomic, assign) BOOL shouldValidate;
  100. /**
  101. Optional: If authentication insight is requested. If this property is set to true, a `merchantAccountId` must be provided. Defaults to false.
  102. */
  103. @property (nonatomic, assign) BOOL authenticationInsightRequested;
  104. /**
  105. Optional: The merchant account id.
  106. */
  107. @property (nonatomic, nullable, copy) NSString *merchantAccountId;
  108. @end
  109. NS_ASSUME_NONNULL_END