update: 新增收据接口
parent
79217aaaac
commit
fa0861c770
|
|
@ -62,6 +62,7 @@ namespace Guru
|
||||||
public event Action<string> OnBuyStart;
|
public event Action<string> OnBuyStart;
|
||||||
public event Action<string, bool> OnBuyEnd;
|
public event Action<string, bool> OnBuyEnd;
|
||||||
public event Action<string, string> OnBuyFailed;
|
public event Action<string, string> OnBuyFailed;
|
||||||
|
public event Action<string, string, bool> OnGetProductReceipt;
|
||||||
|
|
||||||
#if UNITY_IOS
|
#if UNITY_IOS
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -510,6 +511,18 @@ namespace Guru
|
||||||
Debug.Log($"############ ProcessPurchase: PurchaseCount:{PurchaseCount}");
|
Debug.Log($"############ ProcessPurchase: PurchaseCount:{PurchaseCount}");
|
||||||
ReportPurchaseResult(purchaseEvent); // 支付结果上报
|
ReportPurchaseResult(purchaseEvent); // 支付结果上报
|
||||||
|
|
||||||
|
var pp = purchaseEvent.purchasedProduct;
|
||||||
|
if ( pp == null || string.IsNullOrEmpty(pp.receipt))
|
||||||
|
{
|
||||||
|
string msg = $"{Tag} --- Purchased product is null or has no receipt!!";
|
||||||
|
Debug.LogError(msg);
|
||||||
|
Crashlytics.LogException(new Exception(msg));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OnGetProductReceipt?.Invoke(pp.definition.id, pp.receipt, pp.appleProductIsRestored);
|
||||||
|
}
|
||||||
|
|
||||||
string productName = info?.Name ?? "NULL";
|
string productName = info?.Name ?? "NULL";
|
||||||
LogI($"{Tag} --- OnPurchaseSuccess :: purchase count: {PurchaseCount} productName: {productName}");
|
LogI($"{Tag} --- OnPurchaseSuccess :: purchase count: {PurchaseCount} productName: {productName}");
|
||||||
|
|
||||||
|
|
@ -626,6 +639,7 @@ namespace Guru
|
||||||
// ----- 支付后的b_level上报逻辑
|
// ----- 支付后的b_level上报逻辑
|
||||||
LogI($"--- Report b_level:[{blevel}] with product id:{args.purchasedProduct.definition.id} ");
|
LogI($"--- Report b_level:[{blevel}] with product id:{args.purchasedProduct.definition.id} ");
|
||||||
|
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
// Editor 不做上报逻辑
|
// Editor 不做上报逻辑
|
||||||
#elif UNITY_ANDROID
|
#elif UNITY_ANDROID
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue