From a161249e631156c0f4d4a287ee5b3058b1299295 Mon Sep 17 00:00:00 2001 From: huyfei Date: Thu, 18 Jan 2024 18:19:53 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0Google=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=B8=8A=E6=8A=A5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IPM/Scripts/Requests/GoogleOrderRequest.cs | 18 ++++++++++++++++++ Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Runtime/GuruCore/Runtime/IPM/Scripts/Requests/GoogleOrderRequest.cs b/Runtime/GuruCore/Runtime/IPM/Scripts/Requests/GoogleOrderRequest.cs index 61d437f..68857be 100644 --- a/Runtime/GuruCore/Runtime/IPM/Scripts/Requests/GoogleOrderRequest.cs +++ b/Runtime/GuruCore/Runtime/IPM/Scripts/Requests/GoogleOrderRequest.cs @@ -53,6 +53,24 @@ namespace Guru Analytics.Tch02IAPRev(usdPrice); AdjustService.TrackIAPPurchase(usdPrice, productId); Analytics.IAPPurchase(usdPrice, productId); + return; + } + + if (!string.IsNullOrEmpty(response)) + { + if (response.Contains("500") || response.Contains("Internal Server Error")) + { + Debug.LogError( + $"[IAP] GoogleOrderRequest failed: contact with guru backend server team. Make sure they'v connect order report to this project!"); + } + else + { + Debug.LogError($"[IAP] GoogleOrderRequest failed: {response}"); + } + } + else + { + Debug.LogError($"[IAP] GoogleOrderRequest failed: response is null or empty"); } } } diff --git a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs index cd8cb26..a6ef3ea 100644 --- a/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs +++ b/Runtime/GuruIAP/Runtime/Code/IAPServiceBase.cs @@ -616,7 +616,7 @@ namespace Guru if (productReceipt is GooglePlayReceipt google) { Debug.Log($"{Tag} --- Report Android IAP Order -> orderType:{orderType} productID:{productID} blevel:{blevel}"); - new GoogleOrderRequest(orderType, productID, subscriptionID, google.purchaseToken, blevel).Send(); + new GoogleOrderRequest(orderType, productID, subscriptionID, google.purchaseToken, blevel).SetTimeOut(5).Send(); } } #elif UNITY_IOS