logCustomPurchase method
Future<void>
logCustomPurchase({
- required TransactionType type,
- required int priceInCents,
- required String currency,
- required String productId,
- 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,
);
}
}