logCustomPurchase method

  1. @override
Future<void> logCustomPurchase({
  1. required TransactionType type,
  2. required int priceInCents,
  3. required String currency,
  4. required String productId,
  5. DateTime? startDate,
})
override

Log a custom purchase

Implementation

@override
Future<void> logCustomPurchase({
  required TransactionType type,
  required int priceInCents,
  required String currency,
  required String productId,
  DateTime? startDate,
}) async {
  try {
    await methodChannel.invokeMethod('logCustomPurchase', {
      'type': type.name,
      'priceInCents': priceInCents,
      'currency': currency,
      'productId': productId,
      'startDate': startDate?.toIso8601String(),
    });
  } on PlatformException catch (e) {
    throw GrovsException(
      e.message ?? 'Failed to log custom purchase',
      code: e.code,
    );
  }
}