public void LoginDomeCallBack(string str)
    {
        if (SDKChannelDome.isDebugDome)
        {
            AN_PoupsProxy.ShowToast("Login Result " + str);
        }

        string[] results = str.Split('|');

        string userId     = results[0];
        string resultCode = results[1];

        SDKLoginResult lr = new SDKLoginResult();

        if (results[1] == "1")
        {
            lr.Result = LoginState.LOGIN_OK;
            lr.UID    = userId;
        }
        else
        {
            //登陆失败
            lr.Result = LoginState.LOGIN_FAILED;
        }
        SDKMgr.Instance.SDKCallback.LoginCallback(lr);
    }
Exemplo n.º 2
0
    protected void HandlePayResult(IPayResult result)
    {
        bool bSuccess = false;

        if (result == null)
        {
            //this.Status = "Null";
        }

        // Some platforms return the empty string instead of null.
        if (!string.IsNullOrEmpty(result.Error))
        {
            //this.Status = "Error";
        }
        else if (result.Cancelled)
        {
            //this.Status = "Cancelled";
        }
        else if (!string.IsNullOrEmpty(result.RawResult))
        {
            //this.Status = "Success";
            bSuccess = true;
            if (mDebug)
            {
                AN_PoupsProxy.ShowToast(result.RawResult);
            }
        }
        else
        {
            //this.Status = "Empty";
        }
        SDKMgr.Instance.SDKCallback.PayCallback(bSuccess);
    }
    private void GetUserNameCallback(IGraphResult result)
    {
        if (result == null)
        {
            AN_PoupsProxy.ShowToast("GetUserName null");
        }

        // Some platforms return the empty string instead of null.
        if (!string.IsNullOrEmpty(result.Error))
        {
            AN_PoupsProxy.ShowToast("GetUserName Error " + result.Error);
        }
        else if (result.Cancelled)
        {
            AN_PoupsProxy.ShowToast("GetUserName Cancelled");
        }
        else if (result.ResultList != null && result.ResultList.Count > 0)
        {
            AN_PoupsProxy.ShowToast("GetUserName Success " + result.ResultList.Count + " " + result.ResultList[0].ToString());
        }
        else
        {
            AN_PoupsProxy.ShowToast("GetUserName Success ResultList IsNullOrEmpty");
        }
    }
Exemplo n.º 4
0
 private void FBPay(string productID, int orderID)
 {
     if (mDebug)
     {
         AN_PoupsProxy.ShowToast("FBPay productID " + productID + " orderID " + orderID);
     }
     FB.Canvas.PayWithProductId(productID, requestId: orderID.ToString(), callback: this.HandlePayResult);
 }
Exemplo n.º 5
0
    private void OnLoginFail()
    {
        if (mDebug)
        {
            AN_PoupsProxy.ShowToast("User cancelled login");
        }
        //登陆失败
        SDKLoginResult lr = new SDKLoginResult();

        lr.Result = LoginState.LOGIN_FAILED;
        SDKMgr.Instance.SDKCallback.LoginCallback(lr);
    }
Exemplo n.º 6
0
    public override void Pay(int itemID, string chargePointName, int orderID, string url, string secret_key)
    {
        //m_AndroidContext.Call("pay", SDKMgr.Instance.CallbackObjName, "PayCallback", amount, itemName, count, chargePointName, customParams, ServerSetting.CALLBACK_URL);

        string url_encoder = AN_UrlEncoderProxy.Encode(url);

        if (isDebugDome)
        {
            AN_PoupsProxy.ShowToast("orderID " + orderID + "url " + url_encoder);
        }

        string info = GetPayInfo(APP_CODE, chargePointName, orderID.ToString(), url_encoder);

        info += "&signCode=" + GetSignCode(info, PRIVATE_KEY);
        DomePayAndroid.Instance.pay(info, SDKMgr.Instance.CallbackObjName, "PayDomeCallBack");
    }
Exemplo n.º 7
0
    private void OnLoginSuccess()
    {
        // AccessToken class will have session details
        var aToken = Facebook.Unity.AccessToken.CurrentAccessToken;

        if (mDebug)
        {
            AN_PoupsProxy.ShowToast("User login id " + aToken.UserId + " token " + aToken.TokenString);
        }
        SDKLoginResult lr = new SDKLoginResult();

        lr.Result = LoginState.LOGIN_OK;
        lr.UID    = aToken.UserId;
        lr.Token  = aToken.TokenString;
        SDKMgr.Instance.SDKCallback.LoginCallback(lr);
        //QueryNickname();
    }
    public void PayDomeCallBack(string str)
    {
        if (SDKChannelDome.isDebugDome)
        {
            AN_PoupsProxy.ShowToast("Pay Result " + str);
        }
        string[] results    = str.Split('|');
        string   resultCode = results[1];
        uint     ret;

        if (resultCode == "1")
        {
            ret = SDK.RESULT_OK;
        }
        else
        {
            // 支付失败
            ret = SDK.RESULT_FAILED;
        }
        SDKMgr.Instance.SDKCallback.PayCallback(ret == SDK.RESULT_OK);
    }
Exemplo n.º 9
0
    private void QueryNicknameCallback(IGraphResult result)
    {
        if (result == null)
        {
            if (mDebug)
            {
                AN_PoupsProxy.ShowToast("QueryNickname null");
            }
        }

        // Some platforms return the empty string instead of null.
        if (!string.IsNullOrEmpty(result.Error))
        {
            if (mDebug)
            {
                AN_PoupsProxy.ShowToast("QueryNickname Error " + result.Error);
            }
        }
        else if (result.Cancelled)
        {
            if (mDebug)
            {
                AN_PoupsProxy.ShowToast("QueryNickname Cancelled");
            }
        }
        else if (!string.IsNullOrEmpty(result.RawResult))
        {
            if (mDebug)
            {
                AN_PoupsProxy.ShowToast("QueryNickname Success " + result.RawResult);
            }
        }
        else
        {
            if (mDebug)
            {
                AN_PoupsProxy.ShowToast("QueryNickname Success RawResult IsNullOrEmpty ");
            }
        }
    }
Exemplo n.º 10
0
 public override void ShowAndroidToast(string info)
 {
     //m_AndroidContext.Call("showToast", info);
     AN_PoupsProxy.ShowToast(info);
 }
Exemplo n.º 11
0
 public override void ShowAndroidToast(string info)
 {
     AN_PoupsProxy.ShowToast(info);
 }