示例#1
0
        public void XmlBalancePay(string orderId)
        {
            this.OrderId = orderId;
            InpourRequestInfo inpourBlance = MemberProcessor.GetInpourBlance(this.OrderId);

            if (inpourBlance == null)
            {
                this.ShowWapMessage("错误的预付款充值ID", "RechargeRequest.aspx");
            }
            else
            {
                string          attach         = "";
                PaymentModeInfo paymentMode    = SalesHelper.GetPaymentMode("hishop.plugins.payment.alipaywx.alipaywxrequest");
                SiteSettings    masterSettings = SettingsManager.GetMasterSettings();
                string          showUrl        = $"http://{HttpContext.Current.Request.Url.Host}/{HiContext.Current.GetClientPath}/";
                string          hIGW           = paymentMode.Gateway.Replace(".", "_");
                string          notifyUrl      = Globals.FullPath(base.GetRouteUrl("WapInpourNotify", new
                {
                    HIGW = hIGW
                }));
                string returnUrl = Globals.FullPath(base.GetRouteUrl("WapInpourReturn", new
                {
                    HIGW = hIGW
                }));
                PaymentRequest paymentRequest = PaymentRequest.CreateInstance(paymentMode.Gateway, HiCryptographer.Decrypt(paymentMode.Settings), this.OrderId, inpourBlance.InpourBlance + default(decimal), "预付款充值", "操作流水号-" + this.OrderId, HiContext.Current.User.Email.ToNullString(), inpourBlance.TradeDate, showUrl, returnUrl, notifyUrl, attach);
                object         obj            = paymentRequest.SendRequest_Ret();
                if (obj.ToNullString().IndexOf("error:") > -1)
                {
                    this.ShowWapMessage("支付错误:" + obj.ToNullString().Replace("error:", ""), "");
                }
                else
                {
                    HttpContext.Current.Response.Clear();
                    HttpContext.Current.Response.Write(obj.ToNullString());
                    HttpContext.Current.Response.End();
                }
            }
        }