Inheritance: MessageBase
Beispiel #1
0
 public override void Submit(IPayHistory order)
 {
     BaseSubmit(order);
     var request = new ChargeSubmit();
     request.MerId = MerchantId;
     request.CmdId = "Buy";
     request.OrdId = order.OrderId;
     request.OrdAmt = order.Amount.ToString("f");
     request.BgRetUrl = NotifyUrl;
     request.RetUrl = ReturnUrl;
     request.ChkValue = request.MakeSign();
     var fields = request.GetType().GetFields();
     //测试
     string html = "<form id='form1' name='form1' action='https://mas.chinapnr.com/gar/RecvMerchant.do' method='post'>\r\n";
     foreach (var item in fields)
     {
         html += string.Format("<input type='hidden' Name='{0}' value='{1}' />\r\n", item.Name, item.GetValue(request));
     }
     html += "</form>\r\n";
     html += "<script>form1.submit()</script>";
     HttpContext.Current.Response.Write(html);
 }
Beispiel #2
0
        public override void Submit(IPayHistory order)
        {
            BaseSubmit(order);
            var request = new ChargeSubmit();

            request.MerId    = MerchantId;
            request.CmdId    = "Buy";
            request.OrdId    = order.OrderId;
            request.OrdAmt   = order.Amount.ToString("f");
            request.BgRetUrl = NotifyUrl;
            request.RetUrl   = ReturnUrl;
            request.ChkValue = request.MakeSign();
            var fields = request.GetType().GetFields();
            //测试
            string html = "<form id='form1' name='form1' action='https://mas.chinapnr.com/gar/RecvMerchant.do' method='post'>\r\n";

            foreach (var item in fields)
            {
                html += string.Format("<input type='hidden' Name='{0}' value='{1}' />\r\n", item.Name, item.GetValue(request));
            }
            html += "</form>\r\n";
            html += "<script>form1.submit()</script>";
            HttpContext.Current.Response.Write(html);
        }