PaymentPagesCheckoutSessionShippingCost.fromJson constructor
PaymentPagesCheckoutSessionShippingCost.fromJson(
- Object? json
Implementation
factory PaymentPagesCheckoutSessionShippingCost.fromJson(Object? json) {
final map = (json as Map).cast<String, Object?>();
return PaymentPagesCheckoutSessionShippingCost(
amountSubtotal: (map['amount_subtotal'] as num).toInt(),
amountTax: (map['amount_tax'] as num).toInt(),
amountTotal: (map['amount_total'] as num).toInt(),
shippingRate: map['shipping_rate'] == null
? null
: ShippingRateOrId.fromJson(map['shipping_rate']),
taxes: map['taxes'] == null
? null
: (map['taxes'] as List<Object?>)
.map((el) => LineItemsTaxAmount.fromJson(el))
.toList(),
);
}