// for garena public void GetGarenaProductInfo(APMidasBaseRequest request, MidasGetLocalPriceCallback callback) { if (!mHasInited) { ULog.LogError("you should call Initialize first"); return; } mMidasGetProductCallback = callback; string reqString = request.ToString(); ULog.Log("GetGarenaProductInfo with json : " + reqString); #if UNITY_EDITOR ULog.Log("use simulator"); #elif UNITY_ANDROID helper = new AndroidJavaClass(helperClass); if (helper == null) { } else { helper.CallStatic("GetProductInfo", reqString); } #elif UNITY_IOS string bizType = request.GetType().Name; ULog.Log("PayType = " + bizType); midasSdkGetGrnProductInfo(bizType, "os_garena", reqString); #endif }
public void GetLocalPrice(string channel, List <string> productList, MidasGetLocalPriceCallback callback) { if (!mHasInited) { Debug.LogError("you should call Initialize first"); return; } mMidasGetProductCallback = callback; if (productList == null || productList.Count == 0) { ULog.LogError("productList is empty"); return; } string products = Json.Serialize(productList); ULog.Log("productList:" + products); #if UNITY_EDITOR ULog.Log("use simulator"); #elif UNITY_ANDROID helper = new AndroidJavaClass(helperClass); if (helper == null) { } else { helper.CallStatic("GetProductInfo", channel, products); } #elif UNITY_IOS midasSdkGetProductInfo(channel, products); #endif }
/// <summary> /// 获取本地价格信息的回调 /// </summary> /// /// <param name="result">Result.</param> public void MidasGetLocalPriceCallback(string resul) { if (mMidasGetProductCallback != null) { Dictionary <string, object> jsonResult = Json.Deserialize(resul) as Dictionary <string, object>; mMidasGetProductCallback.OnMidasGetProdcut(jsonResult); mMidasGetProductCallback = null; } }