Inheritance: MessageBase
Example #1
0
 public override void Submit(IPayHistory order)
 {
     BaseSubmit(order);
     var request = new ChargeRequest();
     request.merchantAcctId = merchantAcctId;
     request.payerName = "";
     request.payerContactType = "1";
     request.orderId = order.OrderId;
     request.orderAmount = (Convert.ToInt32(order.Amount) * 100).ToString();
     request.orderTime = DateTime.Now.ToString("yyyyMMddHHmmss");
     request.productName = "在线支付";
     request.productNum = "1";
     request.productDesc = "在线支付";
     request.payType = "00";
     request.ext1 = order.UserId;
     request.bgUrl = notify_url;
     request.MakeSign();
     var fields = request.GetType().GetProperties();
     //测试
     string html = "<form id='form1' name='form1' action='https://sandbox.99bill.com/gateway/recvMerchantInfoAction.htm' 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, null));
     }
     html += "</form>\r\n";
     html += "<script>form1.submit()</script>";
     //Log(html);
     HttpContext.Current.Response.Write(html);
 }