Ejemplo n.º 1
0
        public override void pay(CommonOrderInfo orderInfo, CommonGameRoleInfo roleInfo)
        {
                        #if UNITY_ANDROID
            if (_javaMainActivity == null)
            {
                return;
            }

            if (orderInfo == null || roleInfo == null)
            {
                return;
            }

            _javaMainActivity.Call("requestPay", orderInfo.goodsID, orderInfo.goodsName, orderInfo.goodsDesc,
                                   orderInfo.quantifier, orderInfo.cpOrderID, orderInfo.callbackUrl, orderInfo.extrasParams,
                                   orderInfo.price + "", orderInfo.amount + "", orderInfo.count + "", roleInfo.serverName,
                                   roleInfo.serverID, roleInfo.gameRoleName, roleInfo.gameRoleID, roleInfo.gameRoleBalance,
                                   roleInfo.vipLevel, roleInfo.gameRoleLevel, roleInfo.partyName);
#else
            _object_c_interface_.SystemUtilsOperation.requestPay(orderInfo.goodsID, orderInfo.goodsName, orderInfo.goodsDesc,
                                                                 orderInfo.quantifier, orderInfo.cpOrderID, orderInfo.callbackUrl, orderInfo.extrasParams,
                                                                 orderInfo.price + "", orderInfo.amount + "", orderInfo.count + "", roleInfo.serverName,
                                                                 roleInfo.serverID, roleInfo.gameRoleName, roleInfo.gameRoleID, roleInfo.gameRoleBalance,
                                                                 roleInfo.vipLevel, roleInfo.gameRoleLevel, roleInfo.partyName);
                        #endif
        }
Ejemplo n.º 2
0
    /// <summary>
    /// 官方安卓支付接口
    /// </summary>
    /// <param name="tag"></param>
    /// <returns></returns>
    public IEnumerator startAndroidOfficialPay(object tag)
    {
        //UtilTools.ShowWaitWin(WaitFlag.AppStorePay);
        int    payTag    = (int)tag;
        string extraInfo = "1";
        int    payType   = 0;

        if (payTag == 1) //微信支付
        {
            extraInfo = "2";
            payType   = 10;
        }

        else if (payTag == 2) // 支付宝支付
        {
            extraInfo = "1";
            payType   = 2;
        }

        Debug.Log(">>> payType = " + payType);
        string strUserID     = GameDataMgr.PLAYER_DATA.Account;
        string strInfoFormat = SDKManager.PlatformPayUrl;
        string strUrlInfo    = string.Format(strInfoFormat, "android", _nCost.ToString(), GameDataMgr.PLAYER_DATA.UserName,
                                             GameDataMgr.LOGIN_DATA.serverId, strUserID, payType, _nCurKey);

        Debug.Log(">>>>>>>>>>>>>>>>>>>>>>> WWW: " + strUrlInfo);
        //向后台请求订单号
        WWW www = new WWW(strUrlInfo);

        yield return(www);

        Debug.Log(">>>>>>>>>>>>>>>>>>>>>>> WWW: " + www.text);

        if (www.isDone && string.IsNullOrEmpty(www.error))
        {
            var orderInfo = new CommonOrderInfo();
            orderInfo.extrasParams = extraInfo;
            orderInfo.cpOrderID    = www.text;
            orderInfo.goodsName    = _sCurName;
            orderInfo.amount       = _nCost;
            orderInfo.goodsDesc    = _sCurDes;
            orderInfo.extrasParams = extraInfo;
            orderInfo.callbackUrl  = SDKManager.PayCallbackUrl;

            var roleInfo = new CommonGameRoleInfo();
            roleInfo.gameRoleName    = GameDataMgr.PLAYER_DATA.UserName;
            roleInfo.gameRoleID      = GameDataMgr.PLAYER_DATA.Account.ToString();
            roleInfo.gameRoleLevel   = GameDataMgr.PLAYER_DATA.Level.ToString();
            roleInfo.gameRoleBalance = GameDataMgr.PLAYER_DATA.Gold.ToString();
            roleInfo.vipLevel        = GameDataMgr.PLAYER_DATA.VipLevel.ToString();
            SDKManager.getInstance().CommonSDKInterface.pay(orderInfo, roleInfo);
            //UtilTools.HideWaitFlag();
            _ctrl.GoBack(null);
        }
    }
Ejemplo n.º 3
0
 public override void updateRoleInfo(CommonGameRoleInfo roleInfo, bool bIsCreatRole)
 {
 }
Ejemplo n.º 4
0
 //更新角色信息(不同渠道需求不同)
 public abstract void updateRoleInfo(CommonGameRoleInfo roleInfo, bool bIsCreatRole);
Ejemplo n.º 5
0
 //支付信息
 public abstract void pay(CommonOrderInfo orderInfo, CommonGameRoleInfo roleInfo);