bodyTrack property

  1. @override
Map<String, Object> get bodyTrack
override

Implementation

@override
Map<String, Object> get bodyTrack {
  var customBody = new Map<String, Object>();
  customBody
      .addAll({"t": typeOfEvent, 'tid': transactionId, 'ta': affiliation});

  // Add revenue
  if (revenue != null) customBody['tr'] = revenue ?? 0;
  // Add shipping
  if (shipping != null) customBody['ts'] = shipping ?? 0;
  // Add Tax
  if (ctax != null) customBody['tt'] = ctax ?? 0;
  // Add currency
  if (currency != null) customBody['tc'] = currency ?? "";
  // Add coupon code
  if (couponCode != null) customBody['tcc'] = couponCode ?? "";
  // Add paymentMethod
  if (paymentMethod != null) customBody['pm'] = paymentMethod ?? "";
  // Add shippingMethod
  if (shippingMethod != null) customBody['sm'] = shippingMethod ?? "";
  // Add item count
  if (itemCount != null) customBody['icn'] = itemCount ?? 0;

  // Add commun data
  customBody.addAll(super.communBodyTrack);
  return customBody;
}