update:支付调整
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace tysdk
|
||||
{
|
||||
@@ -16,6 +18,8 @@ namespace tysdk
|
||||
public static class AccountInfo
|
||||
{
|
||||
public static string hwVkid = "vk.global.app";
|
||||
public static string hwPayType = "rustore.global.app";
|
||||
public static string googlePayType = "googleiab.global.app";
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +100,18 @@ namespace tysdk
|
||||
}
|
||||
#endif
|
||||
|
||||
public List<SKUDetail> BaseReadSkuFromData(string productData)
|
||||
{
|
||||
var jsonObjList = JsonConvert.DeserializeObject<List<SKUDetail>>(productData);
|
||||
products = jsonObjList;
|
||||
return jsonObjList;
|
||||
}
|
||||
public List<SKUDetail> ReadSkuFromData(string productData, EAccoutType accountChannel)
|
||||
{
|
||||
var jsonObjList = JsonConvert.DeserializeObject<List<SKUDetail>>(productData);
|
||||
products = jsonObjList;
|
||||
return jsonObjList;
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_IOS
|
||||
@@ -125,7 +141,9 @@ namespace tysdk
|
||||
public string description;
|
||||
public string ourProductId;
|
||||
public string price;
|
||||
public string price_amount_micros;
|
||||
|
||||
[JsonProperty("price_amount_micros")]
|
||||
public string price_amount_micros { get; set; }
|
||||
public string price_currency_code;
|
||||
public string productId;
|
||||
public string title;
|
||||
@@ -137,7 +155,16 @@ namespace tysdk
|
||||
}
|
||||
|
||||
public string ProdPriceStr => price;
|
||||
public float ProdPrice => float.Parse(price_amount_micros) / 1000000;
|
||||
//public float ProdPrice => float.Parse(price_amount_micros) / 1000000;
|
||||
public float ProdPrice
|
||||
{
|
||||
get
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(price_amount_micros) || !long.TryParse(price_amount_micros, out var micros))
|
||||
return 0f;
|
||||
return micros / 1_000_000f;
|
||||
}
|
||||
}
|
||||
public string ProdID => ourProductId;
|
||||
public string ProdKey => productId;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user