CheckoutSessionTotalDetails.fromJson constructor

CheckoutSessionTotalDetails.fromJson(
  1. Object? json
)

Implementation

factory CheckoutSessionTotalDetails.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return CheckoutSessionTotalDetails(
    amountDiscount: (map['amount_discount'] as num).toInt(),
    amountShipping: map['amount_shipping'] == null
        ? null
        : (map['amount_shipping'] as num).toInt(),
    amountTax: (map['amount_tax'] as num).toInt(),
    breakdown: map['breakdown'] == null
        ? null
        : PaymentPagesCheckoutSessionTotalDetailsResourceBreakdown.fromJson(
            map['breakdown']),
  );
}