update:更新Tysdk
This commit is contained in:
@@ -182,17 +182,18 @@ public class SDKTest : MonoBehaviour
|
|||||||
public async void OnPayTestBtn()
|
public async void OnPayTestBtn()
|
||||||
{
|
{
|
||||||
_messageTxt.text = "";
|
_messageTxt.text = "";
|
||||||
// if (sku == null){
|
if (sku == null){
|
||||||
// _messageTxt.text = "no product";
|
_messageTxt.text = "no product";
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
var sku = new SKUDetail();
|
// var sku = new SKUDetail();
|
||||||
sku.productId = "com.arkgame.ft.1chooseone0199";
|
// sku.productId = "com.arkgame.ft.1chooseone0199";
|
||||||
sku.ourProductId= "comarkgameftcharge0199";
|
// sku.ourProductId= "comarkgameftcharge0199";
|
||||||
sku.title = "$1.99 choose one" ;
|
// sku.title = "$1.99 choose one" ;
|
||||||
|
// // sku.price = "16900";
|
||||||
|
// // sku.price = 169;
|
||||||
// sku.price = "16900";
|
// sku.price = "16900";
|
||||||
sku.ruPrice = 169;
|
|
||||||
|
|
||||||
|
|
||||||
var purchaseInfo = new JObject();
|
var purchaseInfo = new JObject();
|
||||||
@@ -202,7 +203,7 @@ public class SDKTest : MonoBehaviour
|
|||||||
purchaseInfo["customData"] = "{\"test\":\"test\"}";
|
purchaseInfo["customData"] = "{\"test\":\"test\"}";
|
||||||
// purchaseInfo[]
|
// purchaseInfo[]
|
||||||
|
|
||||||
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(sku, 1, sku.ruPrice, purchaseInfo);
|
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(sku, 1, sku.ProdPrice, purchaseInfo);
|
||||||
_messageTxt.text = "\n" + $"Success : {payResult.isSuccess}";
|
_messageTxt.text = "\n" + $"Success : {payResult.isSuccess}";
|
||||||
_messageTxt.text += "\n" + $"message : {payResult.msg}";
|
_messageTxt.text += "\n" + $"message : {payResult.msg}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ public class ConfigManager {
|
|||||||
public static String SDK_GAMEID = "20587";
|
public static String SDK_GAMEID = "20587";
|
||||||
public static String SDK_PROJECTID = "20587";
|
public static String SDK_PROJECTID = "20587";
|
||||||
public static String SDK_CLOUDID = "128";
|
public static String SDK_CLOUDID = "128";
|
||||||
public static String SDK_CLIENTID = "Android_5.00_tyGuest,facebook.googleplay.0-hall20587.googleplay.FishingMaster";
|
public static String SDK_CLIENTID = "Android_5.00_tyGuest,facebook.googleplay.0-hall20587.rustore.FishingTravel";
|
||||||
|
|
||||||
public static String SDK_LOGIN_SERVER_URL = "https://128-hwsfsdk-sdk-online01.qijihdhk.com";
|
public static String SDK_LOGIN_SERVER_URL = "https://128-hwsfsdk-sdk-online01.qijihdhk.com";
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -436,8 +436,6 @@ namespace tysdk
|
|||||||
|
|
||||||
#if UNITY_ANDROID
|
#if UNITY_ANDROID
|
||||||
string clientid = "Android_5.00_tyGuest,facebook.googleplay.0-hall20587.googleplay.FishingMaster";
|
string clientid = "Android_5.00_tyGuest,facebook.googleplay.0-hall20587.googleplay.FishingMaster";
|
||||||
|
|
||||||
clientid = "Android_5.00_tyGuest,facebook.googleplay.0-hall20587.rustore.FishingTravel";
|
|
||||||
#elif UNITY_IOS
|
#elif UNITY_IOS
|
||||||
string clientid = "IOS_5.00_tyGuest,facebook,appStore.appStore.0-hall20587.appStore.FishingMaster";
|
string clientid = "IOS_5.00_tyGuest,facebook,appStore.appStore.0-hall20587.appStore.FishingMaster";
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -160,9 +160,11 @@ namespace tysdk
|
|||||||
// // result.products = jsonObjList;
|
// // result.products = jsonObjList;
|
||||||
// result.BaseReadSkuFromData(productStr);
|
// result.BaseReadSkuFromData(productStr);
|
||||||
// }
|
// }
|
||||||
|
// result.BaseReadSkuFromData(productStr);
|
||||||
#elif UNITY_IOS && !UNITY_EDITOR
|
#elif UNITY_IOS && !UNITY_EDITOR
|
||||||
result.ReadSKUFromJson(productStr);
|
result.ReadSKUFromJson(productStr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TYSDKCallbackManager.Instance.TryTriggerCallback(result);
|
TYSDKCallbackManager.Instance.TryTriggerCallback(result);
|
||||||
|
|||||||
@@ -136,43 +136,52 @@ namespace tysdk
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
// 注意 这个值支持Rustore
|
||||||
|
// #if UNITY_RUSTORE_ANDROID
|
||||||
public class SKUDetail
|
public class SKUDetail
|
||||||
{
|
{
|
||||||
public string description;
|
public string description;
|
||||||
public string ourProductId;
|
public string ourProductId;
|
||||||
public string price;
|
|
||||||
public float ruPrice;
|
|
||||||
|
|
||||||
[JsonProperty("price_amount_micros")]
|
|
||||||
public string price_amount_micros { get; set; }
|
|
||||||
public string price_currency_code;
|
|
||||||
public string productId;
|
public string productId;
|
||||||
|
public string price;
|
||||||
public string title;
|
public string title;
|
||||||
public string type;
|
public string ProdPriceStr => price;
|
||||||
|
public float ProdPrice => float.Parse(price) / 100 ;
|
||||||
|
public string ProdID => ourProductId;
|
||||||
|
public string ProdKey => productId;
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
return JsonConvert.SerializeObject(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ProdPriceStr => price;
|
}
|
||||||
|
// #else
|
||||||
|
// public class SKUDetail
|
||||||
|
// {
|
||||||
|
// public string description;
|
||||||
|
// public string ourProductId;
|
||||||
|
// public string price;
|
||||||
|
// [JsonProperty("price_amount_micros")]
|
||||||
|
// public string price_amount_micros { get; set; }
|
||||||
|
// public string price_currency_code;
|
||||||
|
// public string productId;
|
||||||
|
// public string title;
|
||||||
|
// public string type;
|
||||||
|
//
|
||||||
|
// public override string ToString()
|
||||||
|
// {
|
||||||
|
// return Newtonsoft.Json.JsonConvert.SerializeObject(this);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// 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
|
//
|
||||||
{
|
// public string ProdID => ourProductId;
|
||||||
get
|
// public string ProdKey => productId;
|
||||||
{
|
// }
|
||||||
if (string.IsNullOrWhiteSpace(price_amount_micros) || !long.TryParse(price_amount_micros, out var micros))
|
// #endif
|
||||||
return 0f;
|
|
||||||
return micros / 1_000_000f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ProdID => ourProductId;
|
|
||||||
public string ProdKey => productId;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
public class ATTInfo
|
public class ATTInfo
|
||||||
{
|
{
|
||||||
public bool isAccepted;
|
public bool isAccepted;
|
||||||
|
|||||||
Reference in New Issue
Block a user