Exemplo n.º 1
0
        public void Pay(EB.IAP.Item item, EB.IAP.Transaction transaction, System.Action <int> callback)
        {
            if (!mInitialized)
            {
                EB.Debug.LogError("AibeiSDKManager.Pay: mInitialized = {0}", mInitialized);
                callback(AibeiConfig.PAY_ERROR);
                return;
            }

            mPayCallback = callback;

            object extraInfo = EB.JSON.Parse(transaction.payload);
            string tid       = EB.Dot.String("tid", extraInfo, string.Empty);
            string transid   = transaction.transactionId;

            EB.Debug.Log("AibeiSDKManager.Pay: tid = {0}", tid);
            EB.Debug.Log("AibeiSDKManager.Pay: transid = {0}", transid);
            EB.Debug.Log("AibeiSDKManager.Pay: appId = {0}", appId);
            if (!string.IsNullOrEmpty(appId))
            {
                AibeiSDK.pxPay(tid, appId);

                //EB.Coroutines.SetTimeout(delegate ()
                //{
                //    OnPayCallback(AibeiConfig.PAY_NO_RESULT);
                //}, 3 * 1000);
            }
        }
Exemplo n.º 2
0
 public void Logout()
 {
     if (mLoggedIn)
     {
         mLoggedIn = false;
         AibeiSDK.pxLogout();
     }
 }
Exemplo n.º 3
0
        public void Login(System.Action <string, object> callback)
        {
            if (mLoggedIn)
            {
                callback(null, null);
                return;
            }

            mLoginCallback      = callback;
            Hub.RunInBackground = true;
            AibeiSDK.pxLogin();
        }
Exemplo n.º 4
0
        public void InitSDK(object options, System.Action <string, bool> callback)
        {
            if (mInitialized)
            {
                EB.Debug.LogWarning("AibeiSDKManager.InitializeSDK: Initialized");
                callback(null, true);
                return;
            }


            //appId = EB.Dot.String("appId", options, null);
            mInitCallback += callback;
            //appId = AibeiSDK.pxGetAppid();
            //appId = EB.Dot.String("appId", options, string.Empty);
            EB.Debug.Log("AibeiSDKManager.InitSDK: appId = {0}", appId);

            Hub.RunInBackground = true;

            new GameObject("aibei_plugin_listener", typeof(SparxAibeiSDKManager));

            AibeiSDK.pxInitSDK(AibeiConfig.ORIENTATION_LANDSCAPE, appId);
        }