コード例 #1
0
        private void btnConfirm_Click(object sender, System.EventArgs e)
        {
            PaymentModeInfo   paymentMode       = TradeHelper.GetPaymentMode(this.paymentModeId);
            InpourRequestInfo inpourRequestInfo = new InpourRequestInfo
            {
                InpourId     = this.GenerateInpourId(),
                TradeDate    = System.DateTime.Now,
                InpourBlance = this.balance,
                UserId       = HiContext.Current.User.UserId,
                PaymentId    = paymentMode.ModeId
            };

            if (PersonalHelper.AddInpourBlance(inpourRequestInfo))
            {
                string attach = "";
                System.Web.HttpCookie httpCookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.User.UserId.ToString()];
                if (httpCookie != null && !string.IsNullOrEmpty(httpCookie.Value))
                {
                    attach = httpCookie.Value;
                }
                string         text           = inpourRequestInfo.InpourId.ToString(System.Globalization.CultureInfo.InvariantCulture);
                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), text, inpourRequestInfo.InpourBlance + (decimal)this.ViewState["PayCharge"], "预付款充值", "操作流水号-" + text, HiContext.Current.User.Email, inpourRequestInfo.TradeDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourReturn_url", new object[]
                {
                    paymentMode.Gateway
                })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourNotify_url", new object[]
                {
                    paymentMode.Gateway
                })), attach);
                paymentRequest.SendRequest();
            }
        }
コード例 #2
0
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            PaymentModeInfo   paymentMode = TradeHelper.GetPaymentMode(this.paymentModeId);
            InpourRequestInfo info3       = new InpourRequestInfo();

            info3.InpourId     = this.GenerateInpourId();
            info3.TradeDate    = DateTime.Now;
            info3.InpourBlance = this.balance;
            info3.UserId       = HiContext.Current.User.UserId;
            info3.PaymentId    = paymentMode.ModeId;
            InpourRequestInfo inpourRequest = info3;

            if (PersonalHelper.AddInpourBlance(inpourRequest))
            {
                string     attach = "";
                HttpCookie cookie = HiContext.Current.Context.Request.Cookies["Token_" + HiContext.Current.User.UserId.ToString()];
                if ((cookie != null) && !string.IsNullOrEmpty(cookie.Value))
                {
                    attach = cookie.Value;
                }
                string orderId = inpourRequest.InpourId.ToString(CultureInfo.InvariantCulture);
                PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), orderId, inpourRequest.InpourBlance + ((decimal)this.ViewState["PayCharge"]), "预付款充值", "操作流水号-" + orderId, HiContext.Current.User.Email, inpourRequest.TradeDate, Globals.FullPath(Globals.GetSiteUrls().Home), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourReturn_url", new object[] { paymentMode.Gateway })), Globals.FullPath(Globals.GetSiteUrls().UrlData.FormatUrl("InpourNotify_url", new object[] { paymentMode.Gateway })), attach).SendRequest();
            }
        }