logRefund static method
E-Commerce Refund event. This event signifies that a refund was issued
Implementation
static Future<void> logRefund({
String? affiliation,
String? coupon,
String? currency,
List<String> items = const [],
double? shipping,
double? tax,
String? transactionId,
double? value,
}) {
currency ??= NumberFormat.simpleCurrency(
locale: SupabaseAddons.systemLocale,
).currencyName;
if (value != null || tax != null || shipping != null) {
assert(
currency != null,
'If you supply the value parameter, you must also supply parameter so that revenue metrics can be computed accurately',
);
}
return logEvent(name: 'refund', params: {
'affiliation': affiliation,
'coupon': coupon,
'currency': currency,
'items': items,
'shipping': shipping,
'tax': tax,
'transactionId': transactionId,
'value': value,
});
}