toJson method
Implementation
Map<String, dynamic> toJson() => {
"id": id,
"parent_id": parentId,
"number": number,
"order_key": orderKey,
"created_via": createdVia,
"version": version,
"status": status,
"currency": currency,
"date_created": dateCreated!.toIso8601String(),
"date_created_gmt": dateCreatedGmt!.toIso8601String(),
"date_modified": dateModified!.toIso8601String(),
"date_modified_gmt": dateModifiedGmt!.toIso8601String(),
"discount_total": discountTotal,
"discount_tax": discountTax,
"shipping_total": shippingTotal,
"shipping_tax": shippingTax,
"cart_tax": cartTax,
"total": total,
"total_tax": totalTax,
"prices_include_tax": pricesIncludeTax,
"customer_id": customerId,
"customer_ip_address": customerIpAddress,
"customer_user_agent": customerUserAgent,
"customer_note": customerNote,
"billing": billing!.toJson(),
"shipping": shipping!.toJson(),
"payment_method": paymentMethod,
"payment_method_title": paymentMethodTitle,
"transaction_id": transactionId,
"date_paid": datePaid,
"date_paid_gmt": datePaidGmt,
"date_completed": dateCompleted!.toIso8601String(),
"date_completed_gmt": dateCompletedGmt!.toIso8601String(),
"cart_hash": cartHash,
"meta_data": List<dynamic>.from(metaData!.map((x) => x.toJson())),
"line_items": List<dynamic>.from(lineItems!.map((x) => x.toJson())),
"tax_lines": List<dynamic>.from(taxLines!.map((x) => x)),
"shipping_lines":
List<dynamic>.from(shippingLines!.map((x) => x.toJson())),
"fee_lines": List<dynamic>.from(feeLines!.map((x) => x)),
"coupon_lines": List<dynamic>.from(couponLines!.map((x) => x)),
"refunds": List<dynamic>.from(refunds!.map((x) => x.toJson())),
"_links": links!.toJson(),
};