update:当前支付成功
This commit is contained in:
@@ -182,17 +182,27 @@ 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();
|
||||||
|
sku.productId = "com.arkgame.ft.1chooseone0199";
|
||||||
|
sku.ourProductId= "comarkgameftcharge0199";
|
||||||
|
sku.title = "$1.99 choose one" ;
|
||||||
|
// sku.price = "16900";
|
||||||
|
sku.ruPrice = 169;
|
||||||
|
|
||||||
|
|
||||||
var purchaseInfo = new JObject();
|
var purchaseInfo = new JObject();
|
||||||
purchaseInfo["ver"] = 2;
|
// purchaseInfo["ver"] = 2;
|
||||||
purchaseInfo["pfid"] = "TestPlayer";
|
purchaseInfo["pfid"] = "TestPlayer";
|
||||||
purchaseInfo["sum"] = sku.ProdPrice;
|
// purchaseInfo["sum"] = sku.ProdPrice;
|
||||||
|
purchaseInfo["customData"] = "{\"test\":\"test\"}";
|
||||||
|
// purchaseInfo[]
|
||||||
|
|
||||||
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(sku, 1, sku.ProdPrice, purchaseInfo);
|
PaymentInfo payResult = await TYSdkFacade.Instance.Pay(sku, 1, sku.ruPrice, 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}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ namespace tysdk
|
|||||||
|
|
||||||
var userId = (int)ulong.Parse(deviceId, System.Globalization.NumberStyles.HexNumber);
|
var userId = (int)ulong.Parse(deviceId, System.Globalization.NumberStyles.HexNumber);
|
||||||
|
|
||||||
|
Debug.Log($"userId -> {userId}");
|
||||||
_accountInfo = new AccountInfo()
|
_accountInfo = new AccountInfo()
|
||||||
{
|
{
|
||||||
userId = userId,
|
userId = userId,
|
||||||
@@ -173,7 +174,7 @@ namespace tysdk
|
|||||||
};
|
};
|
||||||
|
|
||||||
#elif UNITY_ANDROID || UNITY_IOS
|
#elif UNITY_ANDROID || UNITY_IOS
|
||||||
var task = TYSDKCallbackManager.Instance.RegisterCallback<LoginInfo>(TimeSpan.FromSeconds(30));
|
var task = TYSDKCallbackManager.Instance.RegisterCallback<LoginInfo>(TimeSpan.FromSeconds(120));
|
||||||
|
|
||||||
UnityBridgeFunc.UnityLogin(accoutType);
|
UnityBridgeFunc.UnityLogin(accoutType);
|
||||||
|
|
||||||
@@ -435,6 +436,8 @@ 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
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ namespace tysdk
|
|||||||
Debug.Log("[TYSdkFacade] pay callback:" + json);
|
Debug.Log("[TYSdkFacade] pay callback:" + json);
|
||||||
var jresult = JObject.Parse(json);
|
var jresult = JObject.Parse(json);
|
||||||
var result = new PaymentInfo();
|
var result = new PaymentInfo();
|
||||||
result.code = jresult["code"].ToString();
|
result.code = jresult["code"]?.ToString();
|
||||||
result.msg = jresult["errStr"].ToString();
|
result.msg = jresult["errStr"]?.ToString();
|
||||||
TYSDKCallbackManager.Instance.TryTriggerCallback(result);
|
TYSDKCallbackManager.Instance.TryTriggerCallback(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,19 +145,21 @@ namespace tysdk
|
|||||||
string productStr = jresult["respObj"].ToString();
|
string productStr = jresult["respObj"].ToString();
|
||||||
result.code = code;
|
result.code = code;
|
||||||
#if UNITY_ANDROID && !UNITY_EDITOR
|
#if UNITY_ANDROID && !UNITY_EDITOR
|
||||||
// var jsonObjList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SKUDetail>>(productStr);
|
|
||||||
// result.products = jsonObjList;
|
var jsonObjList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SKUDetail>>(productStr);
|
||||||
var accountChannel = _accountInfo.channel;
|
result.products = jsonObjList;
|
||||||
if (accountChannel == EAccoutType.hwVkid)
|
|
||||||
{
|
// var accountChannel = _accountInfo.channel;
|
||||||
result.ReadSkuFromData(productStr, accountChannel);
|
// if (accountChannel == EAccoutType.hwVkid)
|
||||||
}
|
// {
|
||||||
else
|
// result.ReadSkuFromData(productStr, accountChannel);
|
||||||
{
|
// }
|
||||||
// var jsonObjList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SKUDetail>>(productStr);
|
// else
|
||||||
// result.products = jsonObjList;
|
// {
|
||||||
result.BaseReadSkuFromData(productStr);
|
// // var jsonObjList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SKUDetail>>(productStr);
|
||||||
}
|
// // result.products = jsonObjList;
|
||||||
|
// result.BaseReadSkuFromData(productStr);
|
||||||
|
// }
|
||||||
#elif UNITY_IOS && !UNITY_EDITOR
|
#elif UNITY_IOS && !UNITY_EDITOR
|
||||||
result.ReadSKUFromJson(productStr);
|
result.ReadSKUFromJson(productStr);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ namespace tysdk
|
|||||||
public string description;
|
public string description;
|
||||||
public string ourProductId;
|
public string ourProductId;
|
||||||
public string price;
|
public string price;
|
||||||
|
public float ruPrice;
|
||||||
|
|
||||||
[JsonProperty("price_amount_micros")]
|
[JsonProperty("price_amount_micros")]
|
||||||
public string price_amount_micros { get; set; }
|
public string price_amount_micros { get; set; }
|
||||||
@@ -165,6 +166,7 @@ namespace tysdk
|
|||||||
return micros / 1_000_000f;
|
return micros / 1_000_000f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ProdID => ourProductId;
|
public string ProdID => ourProductId;
|
||||||
public string ProdKey => productId;
|
public string ProdKey => productId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user