SquareDash/Library/PackageCache/com.unity.services.analytics@4.3.0/Runtime/Events/TransactionFailed/AnalyticsServiceInstance.TransactionFailed.cs
kingjuulian06 0efb85038a Arbeit 2
2023-11-21 22:03:49 +01:00

39 lines
1.2 KiB
C#

using System;
using UnityEngine;
namespace Unity.Services.Analytics
{
partial class AnalyticsServiceInstance
{
public void TransactionFailed(TransactionFailedParameters parameters)
{
if (!ServiceEnabled)
{
return;
}
if (string.IsNullOrEmpty(parameters.TransactionName))
{
Debug.LogError("Required to have a value for transactionName");
}
if (parameters.TransactionType.Equals(TransactionType.INVALID))
{
Debug.LogError("Required to have a value for transactionType");
}
if (string.IsNullOrEmpty(parameters.FailureReason))
{
Debug.LogError("Required to have a failure reason in transactionFailed event");
}
if (string.IsNullOrEmpty(parameters.PaymentCountry))
{
parameters.PaymentCountry = Internal.Platform.UserCountry.Name();
}
dataGenerator.TransactionFailed(ref dataBuffer, DateTime.Now, m_CommonParams, "com.unity.services.analytics.events.TransactionFailed", parameters);
}
}
}