public static AnalyticsResult Transaction(string productId, decimal amount, string currency, string receiptPurchaseData, string signature, bool usingIAPService)
{
if (string.IsNullOrEmpty(productId))
{
throw new ArgumentException("Cannot set productId to an empty or null string");
}
if (string.IsNullOrEmpty(currency))
{
throw new ArgumentException("Cannot set currency to an empty or null string");
}
UnityAnalyticsHandler unityAnalyticsHandler = GetUnityAnalyticsHandler();
if (unityAnalyticsHandler == null)
{
return(AnalyticsResult.NotInitialized);
}
if (receiptPurchaseData == null)
{
receiptPurchaseData = string.Empty;
}
if (signature == null)
{
signature = string.Empty;
}
return(unityAnalyticsHandler.Transaction(productId, Convert.ToDouble(amount), currency, receiptPurchaseData, signature, usingIAPService));
}