update:当前支付成功

This commit is contained in:
2026-01-29 18:02:40 +08:00
parent 9f1379c465
commit b3869d3488
4 changed files with 41 additions and 24 deletions

View File

@@ -110,8 +110,8 @@ namespace tysdk
Debug.Log("[TYSdkFacade] pay callback:" + json);
var jresult = JObject.Parse(json);
var result = new PaymentInfo();
result.code = jresult["code"].ToString();
result.msg = jresult["errStr"].ToString();
result.code = jresult["code"]?.ToString();
result.msg = jresult["errStr"]?.ToString();
TYSDKCallbackManager.Instance.TryTriggerCallback(result);
}
@@ -145,19 +145,21 @@ namespace tysdk
string productStr = jresult["respObj"].ToString();
result.code = code;
#if UNITY_ANDROID && !UNITY_EDITOR
// var jsonObjList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SKUDetail>>(productStr);
// result.products = jsonObjList;
var accountChannel = _accountInfo.channel;
if (accountChannel == EAccoutType.hwVkid)
{
result.ReadSkuFromData(productStr, accountChannel);
}
else
{
// var jsonObjList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SKUDetail>>(productStr);
// result.products = jsonObjList;
result.BaseReadSkuFromData(productStr);
}
var jsonObjList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SKUDetail>>(productStr);
result.products = jsonObjList;
// var accountChannel = _accountInfo.channel;
// if (accountChannel == EAccoutType.hwVkid)
// {
// result.ReadSkuFromData(productStr, accountChannel);
// }
// else
// {
// // var jsonObjList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SKUDetail>>(productStr);
// // result.products = jsonObjList;
// result.BaseReadSkuFromData(productStr);
// }
#elif UNITY_IOS && !UNITY_EDITOR
result.ReadSKUFromJson(productStr);
#endif