encode method
Implementation
Object encode() {
final Map<Object?, Object?> receiptMap = <Object?, Object?>{};
receiptMap['transactionID'] = transactionID ?? '';
receiptMap['id'] = id ?? '';
receiptMap['customerId'] = customerId ?? '';
receiptMap['customerName'] = customerName ?? '';
receiptMap['customerEmail'] = customerEmail ?? '';
receiptMap['customerMobile'] = customerMobile ?? '';
receiptMap['displayCustomer'] = displayCustomer ?? false;
receiptMap['displaySeller'] = displaySeller ?? false;
receiptMap['ticketId'] = ticketId ?? '';
receiptMap['ticketName'] = ticketName ?? '';
receiptMap['sellerId'] = sellerId ?? '';
receiptMap['sellerName'] = sellerName ?? '';
receiptMap['currencyCode'] = currencyCode ?? '';
receiptMap['countryCode'] = countryCode ?? '';
receiptMap['deviceId'] = deviceId ?? '';
receiptMap['taxInclusive'] = taxInclusive ?? false;
receiptMap['totalValue'] = totalValue ?? 0.0;
receiptMap['totalCost'] = totalCost ?? 0.0;
receiptMap['totalMarkup'] = totalMarkup ?? 0.0;
receiptMap['totalDiscount'] = totalDiscount ?? 0.0;
receiptMap['totalTax'] = totalTax ?? 0.0;
receiptMap['amountTendered'] = amountTendered ?? 0.0;
receiptMap['amountChange'] = amountChange ?? 0.0;
receiptMap['transactionDate'] = transactionDate ?? '';
receiptMap['transactionTime'] = transactionTime ?? '';
receiptMap['businessName'] = businessName ?? '';
receiptMap['address'] = address?.encode() ?? {};
receiptMap['vAT'] = vAT ?? '';
receiptMap['tell'] = tell ?? '';
receiptMap['checkoutMessage'] = checkoutMessage ?? '';
receiptMap['taxCode'] = taxCode ?? '';
receiptMap['taxValue'] = taxValue ?? 0.0;
receiptMap['items'] = items?.map((item) => item?.encode() ?? {}).toList() ?? <Object?>[];
receiptMap['header'] = header ?? '';
receiptMap['footer'] = footer ?? '';
receiptMap['instagram'] = instagram ?? '';
receiptMap['website'] = website ?? '';
receiptMap['whatsapp'] = whatsapp ?? '';
receiptMap['image'] = image ?? Uint8List(0);
receiptMap['cashbackAmount'] = cashbackAmount ?? 0.0;
receiptMap['tipAmount'] = tipAmount ?? 0.0;
receiptMap['totalDue'] = totalDue ?? 0.0;
receiptMap['withdrawalAmount'] = withdrawalAmount ?? 0.0;
receiptMap['paymentType'] = paymentType ?? '';
receiptMap['transactionReference'] = transactionReference ?? '';
return receiptMap;
}