CheckoutSessionCustomerDetails.fromJson constructor

CheckoutSessionCustomerDetails.fromJson(
  1. Object? json
)

Implementation

factory CheckoutSessionCustomerDetails.fromJson(Object? json) {
  final map = (json as Map).cast<String, Object?>();
  return CheckoutSessionCustomerDetails(
    address: map['address'] == null ? null : Address.fromJson(map['address']),
    email: map['email'] == null ? null : (map['email'] as String),
    name: map['name'] == null ? null : (map['name'] as String),
    phone: map['phone'] == null ? null : (map['phone'] as String),
    taxExempt: map['tax_exempt'] == null
        ? null
        : CheckoutSessionCustomerDetailsTaxExempt.fromJson(map['tax_exempt']),
    taxIds: map['tax_ids'] == null
        ? null
        : (map['tax_ids'] as List<Object?>)
            .map((el) => PaymentPagesCheckoutSessionTaxId.fromJson(el))
            .toList(),
  );
}