@Nullable public static BankAccount fromJson(@Nullable JSONObject jsonObject) { if (jsonObject == null) { return null; } return new BankAccount( StripeJsonUtils.optString(jsonObject, FIELD_ACCOUNT_HOLDER_NAME), asBankAccountType( StripeJsonUtils.optString(jsonObject, FIELD_ACCOUNT_HOLDER_TYPE)), StripeJsonUtils.optString(jsonObject, FIELD_BANK_NAME), StripeJsonUtils.optCountryCode(jsonObject, FIELD_COUNTRY), StripeJsonUtils.optCurrency(jsonObject, FIELD_CURRENCY), StripeJsonUtils.optString(jsonObject, FIELD_FINGERPRINT), StripeJsonUtils.optString(jsonObject, FIELD_LAST4), StripeJsonUtils.optString(jsonObject, FIELD_ROUTING_NUMBER)); } }
builder.addressZipCheck(optString(jsonObject, FIELD_ADDRESS_ZIP_CHECK)); builder.brand(asCardBrand(optString(jsonObject, FIELD_BRAND))); builder.country(optCountryCode(jsonObject, FIELD_COUNTRY)); builder.customer(optString(jsonObject, FIELD_CUSTOMER)); builder.currency(optCurrency(jsonObject, FIELD_CURRENCY));