toJson method

  1. @override
Map<String, Object?> toJson()
override

Copyright (c) 2019 Inomera Research. Author Burak Soykal

Implementation

@override
Map<String, Object?> toJson() {
  Map<String, Object?> map = super.toJson();

  List<Map<String, Object?>> lineItemMap = new List.empty(growable: true);
  for (NetmeraLineItem item in _lineItems!) {
    lineItemMap.add(item.toJson());
  }

  map['er'] = _subTotal;
  map['es'] = _grandTotal;
  map['ec'] = _itemCount;
  map['fz'] = _productCount;
  map['items'] = lineItemMap;
  map['em'] = _paymentMethod;
  map['ep'] = _shippingCost;
  map['el'] = _discount;
  map['ek'] = _coupon;
  return map;
}