//public static LoginCallBack OnLoginCallBack; static void OnLogin(Dictionary <string, string> data) { bool isSuccess = bool.Parse(data[SDKInterfaceDefine.ParameterName_IsSuccess]); string accountId = data[SDKInterfaceDefine.Login_ParameterName_AccountId]; OnLoginInfo info = new OnLoginInfo(); info.isSuccess = isSuccess; info.accountId = accountId; Debug.Log("SDKManagerNew OnLogin " + accountId); if (data.ContainsKey(SDKInterfaceDefine.Login_ParameterName_loginPlatform)) { info.loginPlatform = (LoginPlatform)Enum.Parse(typeof(LoginPlatform), data[SDKInterfaceDefine.Login_ParameterName_loginPlatform]); } if (SDKManager.LoginCallBack != null) { try { SDKManager.LoginCallBack(info); } catch (Exception e) { Debug.LogError("OnLogin Error " + e.ToString()); } } }
/// <summary> /// 实名制sdk触发 登出 (如切换账号等) /// </summary> /// <param name="data"></param> static void OnRealNameLogout(Dictionary <string, string> data) { if (SDKManager.RealNameLogoutCallBack != null) { SDKManager.RealNameLogoutCallBack(); } }
protected void PayCallBack(OnPayInfo info) { //info.storeName = GetStoreName(); if (SDKManager.PayCallBack != null) { SDKManager.PayCallBack(info); } }
/// <summary> /// 支付限制的结果回调 /// </summary> /// <param name="data"></param> static void OnPayLimitCallBack(Dictionary <string, string> data) { bool isLimit = bool.Parse(data[SDKInterfaceDefine.RealName_ParameterName_IsPayLimit]); int payAmount = int.Parse(data[SDKInterfaceDefine.RealName_ParameterName_PayAmount]); if (SDKManager.PayLimitCallBack != null) { SDKManager.PayLimitCallBack(isLimit, payAmount); } }
static void OnRealNameCallBack(Dictionary <string, string> data) { try { RealNameData realNameData = new RealNameData(); realNameData.isAdult = bool.Parse(data[SDKInterfaceDefine.RealName_FunctionName_IsAdult]); realNameData.realNameStatus = (RealNameStatus)Enum.Parse(typeof(RealNameStatus), data[SDKInterfaceDefine.RealName_ParameterName_RealNameStatus]); if (SDKManager.RealNameCallBack != null) { SDKManager.RealNameCallBack(realNameData); } } catch (Exception e) { Debug.LogError("OnRealNameCallBack Error" + e.ToString() + e.StackTrace); } }
/// <summary> /// 获取商品信息回调 /// </summary> /// <param name="data"></param> static void OnGetGoodsInfo(Dictionary <string, string> data) { string goodsId = data[SDKInterfaceDefine.Pay_ParameterName_GoodsID]; string localizedPriceString = data[SDKInterfaceDefine.Pay_ParameterName_LocalizedPriceString]; GoodsInfoFromSDK goodsInfoFromSDK = new GoodsInfoFromSDK(goodsId, localizedPriceString); try { if (SDKManager.GoodsInfoCallBack != null) { SDKManager.GoodsInfoCallBack(goodsInfoFromSDK); } } catch (Exception e) { Debug.LogError("OnGetGoodsInfo Error" + e.ToString() + e.StackTrace); } }
static void OnADCallBack(Dictionary <string, string> data) { try { OnADInfo info = new OnADInfo(); info.aDType = (ADType)Enum.Parse(typeof(ADType), data[SDKInterfaceDefine.AD_ParameterName_ADType]); info.result = (ADResult)Enum.Parse(typeof(ADResult), data[SDKInterfaceDefine.AD_ParameterName_ADResult]); info.tag = data[SDKInterfaceDefine.Tag]; if (SDKManager.ADCallBack != null) { SDKManager.ADCallBack(info); } } catch (Exception e) { Debug.LogError("OnPayCallBack Error" + e.ToString() + e.StackTrace); } }
static void OnPay(Dictionary <string, string> data) { OnPayInfo info = new OnPayInfo(); bool isSuccess = bool.Parse(data[SDKInterfaceDefine.ParameterName_IsSuccess]); StoreName storeName = (StoreName)Enum.Parse(typeof(StoreName), data[SDKInterfaceDefine.Pay_ParameterName_Payment]); string goodsId = data[SDKInterfaceDefine.Pay_ParameterName_GoodsID]; string orderID = data[SDKInterfaceDefine.Pay_ParameterName_OrderID]; string currency = data[SDKInterfaceDefine.Pay_ParameterName_Currency]; string goodsName = data[SDKInterfaceDefine.Pay_ParameterName_GoodsName]; string receipt = data[SDKInterfaceDefine.Pay_ParameterName_Receipt]; float price = float.Parse(data[SDKInterfaceDefine.Pay_ParameterName_Price]); GoodsType goodsType = (GoodsType)Enum.Parse(typeof(GoodsType), data[SDKInterfaceDefine.Pay_ParameterName_GoodsType]); if (data.ContainsKey(SDKInterfaceDefine.ParameterName_Error)) { info.error = data[SDKInterfaceDefine.ParameterName_Error]; } info.isSuccess = isSuccess; info.storeName = storeName; info.goodsId = goodsId; info.orderID = orderID; info.currency = currency; info.goodsName = goodsName; info.receipt = receipt; info.price = price; info.goodsType = goodsType; try { if (SDKManager.PayCallBack != null) { SDKManager.PayCallBack(info); } } catch (Exception e) { Debug.LogError("OnPayCallBack Error" + e.ToString() + e.StackTrace); } }