trackPurchase method

Future<void> trackPurchase(
  1. String orderId,
  2. double orderPrice,
  3. List<PurchaseLineItemWire> items,
  4. String? deliveryType,
  5. String? deliveryAddress,
  6. String? paymentType,
  7. bool isTaxFree,
  8. String? promocode,
  9. double? orderCash,
  10. double? orderBonuses,
  11. double? orderDelivery,
  12. double? orderDiscount,
  13. String? channel,
  14. String? customJson,
  15. String? recommendedSourceJson,
  16. String? stream,
  17. String? segment,
  18. String? shopId,
)

customJson and recommendedSourceJson are JSON object strings or null.

Implementation

Future<void> trackPurchase(String orderId, double orderPrice, List<PurchaseLineItemWire> items, String? deliveryType, String? deliveryAddress, String? paymentType, bool isTaxFree, String? promocode, double? orderCash, double? orderBonuses, double? orderDelivery, double? orderDiscount, String? channel, String? customJson, String? recommendedSourceJson, String? stream, String? segment, String? shopId) async {
  final String pigeonVar_channelName = 'dev.flutter.pigeon.personalization_flutter_sdk.PersonalizationHostApi.trackPurchase$pigeonVar_messageChannelSuffix';
  final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
    pigeonVar_channelName,
    pigeonChannelCodec,
    binaryMessenger: pigeonVar_binaryMessenger,
  );
  final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[orderId, orderPrice, items, deliveryType, deliveryAddress, paymentType, isTaxFree, promocode, orderCash, orderBonuses, orderDelivery, orderDiscount, channel, customJson, recommendedSourceJson, stream, segment, shopId]);
  final List<Object?>? pigeonVar_replyList =
      await pigeonVar_sendFuture as List<Object?>?;
  if (pigeonVar_replyList == null) {
    throw _createConnectionError(pigeonVar_channelName);
  } else if (pigeonVar_replyList.length > 1) {
    throw PlatformException(
      code: pigeonVar_replyList[0]! as String,
      message: pigeonVar_replyList[1] as String?,
      details: pigeonVar_replyList[2],
    );
  } else {
    return;
  }
}