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); } }
public void Logout() { if (mLoggedIn) { mLoggedIn = false; AibeiSDK.pxLogout(); } }
public void Login(System.Action <string, object> callback) { if (mLoggedIn) { callback(null, null); return; } mLoginCallback = callback; Hub.RunInBackground = true; AibeiSDK.pxLogin(); }
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); }