test(sdk): 更新 SDK 测试脚本支付配置

- 添加 iOS 平台专用产品 SKU 配置
- 更新购买信息结构,添加自定义数据字段
- 启用测试服务器 URL 配置
- 添加 System.Collections.Generic 引用

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-28 23:11:17 +08:00
parent fa1aa0662a
commit 6ec1b20d36

View File

@@ -1,4 +1,5 @@
using System; using System;
using System.Collections.Generic;
using AppsFlyerSDK; using AppsFlyerSDK;
using asap.core; using asap.core;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
@@ -62,8 +63,8 @@ public class SDKTest : MonoBehaviour
Debug.Log("SDKTest Start"); Debug.Log("SDKTest Start");
//=============================================================================== //===============================================================================
//====================== Test Server =========================== //====================== Test Server ===========================
//UnityBridgeFunc.UnityResetServerUrl("https://128-hwsfsdk-sdk-test01.qijihdhk.com"); // UnityBridgeFunc.UnityResetServerUrl("https://128-hwsfsdk-sdk-test01.qijihdhk.com");
//config.Set("AGG_SERVER", "https://128-hwsfsdk-sdk-test01.qijihdhk.com"); // config.Set("AGG_SERVER", "https://128-hwsfsdk-sdk-test01.qijihdhk.com");
//====================== Test Server =========================== //====================== Test Server ===========================
//=============================================================================== //===============================================================================
// //
@@ -111,6 +112,8 @@ public class SDKTest : MonoBehaviour
var customId = TDAnalytics.GetDistinctId(); var customId = TDAnalytics.GetDistinctId();
var customId_2 = TDAnalytics.GetDistinctId("0caf287574bd4a9bb08be8995705ef6f"); var customId_2 = TDAnalytics.GetDistinctId("0caf287574bd4a9bb08be8995705ef6f");
Debug.Log($"customId = {customId}, customId_2 = {customId_2}"); Debug.Log($"customId = {customId}, customId_2 = {customId_2}");
UnityBridgeFunc.UnityResetServerUrl("https://128-hwsfsdk-sdk-test01.qijihdhk.com");
} }
int retryAttempt; int retryAttempt;
@@ -175,10 +178,16 @@ public class SDKTest : MonoBehaviour
return; return;
} }
#if !UNITY_EDITOR && UNITY_IOS
sku.productId = "comarkgameftpack0199";
sku.title = "商店-体力直充1.99" ;
sku.price = "1.99";
#endif
var purchaseInfo = new JObject(); var purchaseInfo = new JObject();
purchaseInfo["ver"] = 2;
purchaseInfo["pfid"] = "TestPlayer"; purchaseInfo["pfid"] = "TestPlayer";
purchaseInfo["sum"] = sku.ProdPrice; purchaseInfo["customData"] = "{\"test\":\"test\"}";
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(sku, 1, sku.ProdPrice, purchaseInfo); PaymentInfo payResult = await TYSdkFacade.Instance.Pay(sku, 1, sku.ProdPrice, purchaseInfo);
_messageTxt.text = "\n" + $"Success : {payResult.isSuccess}"; _messageTxt.text = "\n" + $"Success : {payResult.isSuccess}";