From d5ec0e9ab126c612051ebb24497615e73853eea4 Mon Sep 17 00:00:00 2001 From: juncong lee Date: Fri, 19 Sep 2025 22:34:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=94=AF=E4=BB=98=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SDKManager/Purchase/IAPOrderManager.cs | 5 ++--- .../SDKManager/Purchase/IAPPurchaseManager.cs | 3 +-- .../SDKManager/Purchase/Server/ServerMgr.cs | 22 ++++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Assets/Script/SDKManager/Purchase/IAPOrderManager.cs b/Assets/Script/SDKManager/Purchase/IAPOrderManager.cs index 38e55d6..b284e3d 100644 --- a/Assets/Script/SDKManager/Purchase/IAPOrderManager.cs +++ b/Assets/Script/SDKManager/Purchase/IAPOrderManager.cs @@ -313,7 +313,7 @@ namespace WZ if (ES3.KeyExists(_purchaseOrderMap)) { List list = ES3.Load(_purchaseOrderMap) as List; - LoggerUtils.Debug("[iap] IAP ProgressCacheOrder 读取失败订单列表,count:" + list.Count + " IAPPurchaseManager.Instance._repeatCountDic" + IAPPurchaseManager.Instance._repeatCountDic.Count); + LoggerUtils.Debug("[iap] IAP ProgressCacheOrder 读取失败订单列表,count:" + list.Count + " repeat count:" + IAPPurchaseManager.Instance._repeatCountDic.Count); if (list.Count > 0) { // 当前进程每条订单校验5次,如果失败则不再处理 @@ -323,7 +323,7 @@ namespace WZ { foreach (var data in list) { - LoggerUtils.Debug("[iap] iap start verify fail order with repeat dic" + data.info["order_id"] + " count:" + IAPPurchaseManager.Instance._repeatCountDic[data.info["order_id"]]); + LoggerUtils.Debug("[iap] iap start verify order with repeat dic" + data.info["order_id"] + " count:" + IAPPurchaseManager.Instance._repeatCountDic[data.info["order_id"]]); if (IAPPurchaseManager.Instance._repeatCountDic.ContainsKey(data.info["order_id"]) && IAPPurchaseManager.Instance._repeatCountDic[data.info["order_id"]] <= 5) { tempData = data; @@ -334,7 +334,6 @@ namespace WZ // 如果还有次数不超过5次的订单,则继续校验,否则就不再处理 if (tempData != null) { - LoggerUtils.Debug("[iap] iap start verify fail order with repeat temp dic" + tempData.info["order_id"] + " count:" + IAPPurchaseManager.Instance._repeatCountDic[tempData.info["order_id"]]); VerifyPurchase(tempData); IAPEvent.LogStarVerifyOrderBySdk(new PurchaseInfo( productName: tempData.info["product_name"], diff --git a/Assets/Script/SDKManager/Purchase/IAPPurchaseManager.cs b/Assets/Script/SDKManager/Purchase/IAPPurchaseManager.cs index bec8784..4144471 100644 --- a/Assets/Script/SDKManager/Purchase/IAPPurchaseManager.cs +++ b/Assets/Script/SDKManager/Purchase/IAPPurchaseManager.cs @@ -2,7 +2,6 @@ using System; using System.Collections; using System.Collections.Generic; -using NUnit.Framework.Constraints; using Unity.Services.Core; using Unity.Services.Core.Environments; using UnityEngine; @@ -382,7 +381,7 @@ namespace WZ /// public void Initialize() { - LoggerUtils.Debug("[iap] IAP Initialize() _storeController.Debug:" + _storeController + " m_StoreExtensionProvider: " + _storeExtensionProvider); + LoggerUtils.Debug("[iap] IAP Initialize() _storeController:" + _storeController + " m_StoreExtensionProvider: " + _storeExtensionProvider); if (_storeController == null && _storeExtensionProvider == null) InitUnityPurchase(); } diff --git a/Assets/Script/SDKManager/Purchase/Server/ServerMgr.cs b/Assets/Script/SDKManager/Purchase/Server/ServerMgr.cs index c8f322e..6982d21 100644 --- a/Assets/Script/SDKManager/Purchase/Server/ServerMgr.cs +++ b/Assets/Script/SDKManager/Purchase/Server/ServerMgr.cs @@ -32,7 +32,7 @@ namespace WZ var ssProperties = new Dictionary { { "is_first", PlayerPrefsUtils.GetPlayerPrefsInt("First_Purchase", 0) == 0 }, - { "IAP", args["iap_name"].ToString() }, + { "IAP", args["product_name"].ToString() }, { "product_id", args["product_id"].ToString() }, { "payment_type", "GooglePlay" }, { "Price", fPrice } @@ -54,6 +54,8 @@ namespace WZ } args.Add("ss_super_properties", JsonConvert.SerializeObject(ssProperties)); + LoggerUtils.Debug("[iap] server verify purchase args: "+JsonConvert.SerializeObject(args)); + LoggerUtils.Debug("[iap] server verify purchase url: "+ StaticValue.VerifyPurchaseUrl); Post(StaticValue.VerifyPurchaseUrl, args, callback); } @@ -68,7 +70,7 @@ namespace WZ EncryptionParameters(args); var requestBody = ConvertDictionaryToJson(args); - LoggerUtils.Debug("[server] url=> " + url +" requestBody=>"+requestBody); + LoggerUtils.Debug("[iap] [server] url=> " + url +" requestBody=>"+requestBody); var encryptBody = EncryptRequestBody(requestBody); if (!string.IsNullOrEmpty(encryptBody)) { @@ -90,7 +92,7 @@ namespace WZ RequestHandler.Instance.SendPostRequest(url, requestBody, headers, (code, res) => { - LoggerUtils.Debug($"[server] res ====> code : {code} res : {res}"); + LoggerUtils.Debug($"[iap] [server] res ====> code : {code} res : {res}"); if (code == 0) { Response resp = null; @@ -103,11 +105,11 @@ namespace WZ } catch (Exception e) { - errorMsg = $"[server] Data conversion exception。{e.Message} {res}"; + errorMsg = $"[iap] [server] Data conversion exception。{e.Message} {res}"; LoggerUtils.Debug(errorMsg); } - LoggerUtils.Debug($"[server] resp ====> code : {resp.code} res : {resp.data}"); + LoggerUtils.Debug($"[iap] [server] resp ====> code : {resp.code} res : {resp.data}"); if (resp != null) { callback(resp.code, resp.msg, resp.data); @@ -122,7 +124,7 @@ namespace WZ callback.Invoke(code, res, new T()); } - LoggerUtils.Debug("[server]" + "[res] " + res); + LoggerUtils.Debug("[iap] [server]" + "[res] " + res); }); } @@ -130,7 +132,7 @@ namespace WZ { var encryptRequestBodyBytes = XXTEA.Encrypt(Encoding.UTF8.GetBytes(requestBody), Encoding.UTF8.GetBytes(XXTEA_KEY)); var encryptRequestBody = EncryptionUtils.BytesToHexString(encryptRequestBodyBytes, false); - LoggerUtils.Debug($"[[server]] [EncryptRequestBody] requestBody = {requestBody} encryptRequestBody = {encryptRequestBody}"); + LoggerUtils.Debug($"[iap] [server] [EncryptRequestBody] requestBody = {requestBody} encryptRequestBody = {encryptRequestBody}"); return encryptRequestBody; } @@ -138,7 +140,7 @@ namespace WZ { var decryptResponseBodyBytes = XXTEA.Decrypt(EncryptionUtils.HexStringToBytes(responseBody), Encoding.UTF8.GetBytes(XXTEA_KEY)); var decryptResponseBody = Encoding.UTF8.GetString(decryptResponseBodyBytes); - LoggerUtils.Debug($"[[server]] [DecryptResponseBody] decryptResponseBody = {decryptResponseBody}"); + LoggerUtils.Debug($"[iap] [[server]] [DecryptResponseBody] decryptResponseBody = {decryptResponseBody}"); return decryptResponseBody; } @@ -179,7 +181,7 @@ namespace WZ args.AddIfNotExists("device_type", "Android"); args.AddIfNotExists("platform_channel", "gp"); args.AddIfNotExists("app_version", Application.version); - args.AddIfNotExists("app_version_code", DataUtils.AndroidVersionCode()); + args.AddIfNotExists("app_version_code", DataUtils.AndroidVersionCode().ToString()); args.AddIfNotExists("language", "ZH"); args.AddIfNotExists("ip", ""); args.AddIfNotExists("device_id", AdjustManager.Instance.GetGdid()); @@ -207,7 +209,7 @@ namespace WZ args.AddIfNotExists("memory_usage", ""); args.AddIfNotExists("country", ""); args.AddIfNotExists("user_id", ""); - args.AddIfNotExists("user_type", ""); + args.AddIfNotExists("user_type", 0); args.AddIfNotExists("ss_distinct_id", TDAnalytics.GetDistinctId() ?? ""); args.AddIfNotExists("ss_account_id", ""); args.AddIfNotExists("ts", "" + TimeUtils.CurrentTimestamp());