StripeCard.fromJson constructor
Implementation
StripeCard.fromJson(Map<String, dynamic> json) {
// Note that we'll never get the CVC or card number in JSON, so those values are null
number = optString(json, FIELD_NUMBER);
cvc = optString(json, FIELD_CVC);
expMonth = optInteger(json, FIELD_EXP_MONTH);
expYear = optInteger(json, FIELD_EXP_YEAR);
addressCity = optString(json, FIELD_ADDRESS_CITY);
addressLine1 = optString(json, FIELD_ADDRESS_LINE1);
addressLine1Check = optString(json, FIELD_ADDRESS_LINE1_CHECK);
addressLine2 = optString(json, FIELD_ADDRESS_LINE2);
addressCountry = optString(json, FIELD_ADDRESS_COUNTRY);
addressState = optString(json, FIELD_ADDRESS_STATE);
addressZip = optString(json, FIELD_ADDRESS_ZIP);
addressZipCheck = optString(json, FIELD_ADDRESS_ZIP_CHECK);
_brand = asCardBrand(optString(json, FIELD_BRAND));
country = optCountryCode(json, FIELD_COUNTRY);
customerId = optString(json, FIELD_CUSTOMER);
currency = optCurrency(json, FIELD_CURRENCY);
cvcCheck = optString(json, FIELD_CVC_CHECK);
funding = asFundingType(optString(json, FIELD_FUNDING));
fingerprint = optString(json, FIELD_FINGERPRINT);
id = optString(json, FIELD_ID);
last4 = optString(json, FIELD_LAST4);
name = optString(json, FIELD_NAME);
tokenizationMethod = optString(json, FIELD_TOKENIZATION_METHOD);
}