Пример #1
0
        //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());
                }
            }
        }
Пример #2
0
 /// <summary>
 /// 实名制sdk触发 登出 (如切换账号等)
 /// </summary>
 /// <param name="data"></param>
 static void OnRealNameLogout(Dictionary <string, string> data)
 {
     if (SDKManager.RealNameLogoutCallBack != null)
     {
         SDKManager.RealNameLogoutCallBack();
     }
 }
Пример #3
0
 protected void PayCallBack(OnPayInfo info)
 {
     //info.storeName = GetStoreName();
     if (SDKManager.PayCallBack != null)
     {
         SDKManager.PayCallBack(info);
     }
 }
Пример #4
0
        /// <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);
            }
        }
Пример #5
0
        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);
            }
        }
Пример #6
0
        /// <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);
            }
        }
Пример #7
0
        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);
            }
        }
Пример #8
0
        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);
            }
        }