SessionPriceData.fromJson constructor
SessionPriceData.fromJson(
- Object? json
Implementation
factory SessionPriceData.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return SessionPriceData(
currency: (map['currency'] as String),
product: map['product'] == null ? null : (map['product'] as String),
productData: map['product_data'] == null
? null
: SessionProductData.fromJson(map['product_data']),
recurring: map['recurring'] == null
? null
: SessionRecurring.fromJson(map['recurring']),
taxBehavior: map['tax_behavior'] == null
? null
: ShippingRateCurrencyOptionTaxBehavior.fromJson(map['tax_behavior']),
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),
);
}