toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = {};
  data['cartId'] = cartId;
  data['intent'] = intent;
  if (items != null) {
    data['items'] = items!.map((v) => v.toJson()).toList();
  }
  if (total != null) {
    data['total'] = total!.toJson();
  }
  if (shippingMethods != null) {
    data['shippingMethods'] =
        shippingMethods!.map((v) => v.toJson()).toList();
  }
  if (shippingAddress != null) {
    data['shippingAddress'] = shippingAddress!.toJson();
  }
  if (billingAddress != null) {
    data['billingAddress'] = billingAddress!.toJson();
  }
  if (totalAllowedOverCaptureAmount != null) {
    data['totalAllowedOverCaptureAmount'] =
        totalAllowedOverCaptureAmount!.toJson();
  }
  return data;
}