fix: 修复支付回调的报失败的BUG
							parent
							
								
									9559b507f4
								
							
						
					
					
						commit
						7dd2215f29
					
				|  | @ -469,20 +469,24 @@ namespace Guru | |||
|         { | ||||
|             string productId = purchaseEvent.purchasedProduct.definition.id; | ||||
|             ProductInfo info = GetInfoById(productId); | ||||
| 
 | ||||
|             if (IsFirstIAP && null != info) | ||||
|             bool success = false; | ||||
|              | ||||
|             if (null != info) | ||||
|             { | ||||
|                 Analytics.FirstIAP(info.Id, info.Price, info.CurrencyCode); // 上报首次支付打点 | ||||
|                 if (IsFirstIAP) Analytics.FirstIAP(info.Id, info.Price, info.CurrencyCode); // 上报首次支付打点 | ||||
|                 Analytics.ProductIAP(info.Id,info.Id, info.Price, info.CurrencyCode); | ||||
|                 Analytics.IAPRetTrue(info.Category, info.Id, info.Price, info.CurrencyCode, info.Type, info.IsFree); | ||||
|                 success = true; | ||||
|             } | ||||
| 
 | ||||
|             Analytics.ProductIAP(info.Id,info.Id, info.Price, info.CurrencyCode); | ||||
|             Analytics.IAPRetTrue(info.Category, info.Id, info.Price, info.CurrencyCode, info.Type, info.IsFree); | ||||
| 
 | ||||
|              | ||||
|             PurchaseCount++; // 记录支付次数 | ||||
|             ReportPurchaseResult(purchaseEvent); // 支付结果上报 | ||||
|              | ||||
|             OnPurchaseOver(true, info.Name); // 支付成功处理逻辑 | ||||
|             OnBuyEnd?.Invoke(info.Name, false); | ||||
|             string productName = info?.Name ?? "NULL"; | ||||
|             LogI($"{Tag} --- OnPurchaseSuccess :: purchase count: {PurchaseCount}  productName: {productName}"); | ||||
|              | ||||
|             OnPurchaseOver(success, productName); // 支付成功处理逻辑 | ||||
|             OnBuyEnd?.Invoke(productName, success); | ||||
|              | ||||
|             return PurchaseProcessingResult.Complete; | ||||
|         } | ||||
|  | @ -508,7 +512,7 @@ namespace Guru | |||
|                 Analytics.IAPRetFalse(info.Category, product.definition.id, failureReason.ToString()); | ||||
|             } | ||||
| 
 | ||||
|             LogI("failureReason = " + failureReason); | ||||
|             LogI($"{Tag} --- OnPurchaseFailed :: failureReason = {failureReason}"); | ||||
|             // 失败的处理逻辑 | ||||
|             OnPurchaseOver(false, info.Name); | ||||
|             OnBuyEnd?.Invoke(info.Name, false); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue