CurrencyOption.fromJson constructor
CurrencyOption.fromJson(
- Object? json
Implementation
factory CurrencyOption.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return CurrencyOption(
customUnitAmount: map['custom_unit_amount'] == null
? null
: CurrencyOptionCustomUnitAmount.fromJson(map['custom_unit_amount']),
taxBehavior: map['tax_behavior'] == null
? null
: CurrencyOptionTaxBehavior.fromJson(map['tax_behavior']),
tiers: map['tiers'] == null
? null
: (map['tiers'] as List<Object?>)
.map((el) => PriceTier.fromJson(el))
.toList(),
unitAmount: map['unit_amount'] == null
? null
: (map['unit_amount'] as num).toInt(),
unitAmountDecimal: map['unit_amount_decimal'] == null
? null
: (map['unit_amount_decimal'] as String),
);
}