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