Esempio n. 1
0
    //订单支付
    public static void userToPay(L_OrderListInfo olistInfo, string moneyTotal)
    {
        //支付网关参数
        string Amount          = string.Format("{0:C2}", moneyTotal).Replace("¥", "");                           //订单金额
        string Mer_code        = System.Configuration.ConfigurationManager.AppSettings["MerchantID"].ToString(); // 6位	商户编号
        string Billno          = olistInfo.OrderID;                                                              // 商户订单编号
        string Date            = olistInfo.OrderTime.ToString("yyyyMMdd");                                       // 8位 订单日期
        string Currency_Type   = "RMB";                                                                          //币种
        string Gateway_Type    = "01";                                                                           //支付卡种
        string Merchanturl     = "http://shop.8517.com/OrderInfo/PayResult.aspx";
        string Attach          = olistInfo.OrderID + "," + olistInfo.UserID;
        string OrderEncodeType = "0";                                                                                                                                // 订单支付接口加密方式 订单支付采用Md5的摘要认证方式
        string RetEncodeType   = "12";                                                                                                                               // 交易返回采用Md5的摘要认证方式
        string cert            = "BjC34p6hPko9f0gXZaxBqGPq7z3L9YIJlNQXbHV7b5oXZg79wLnJomiUuwVfLK7R25yrAiWsfQ9L1Rq1RTzOKY5ZFVCFMPLrXx54IpZnPVExCw23f4oSuJg3ZyCE6r5p"; //IPS证书
        string SignMD5         = Billno + Amount + Date + Currency_Type + cert;                                                                                      //Sigmd5=订单号+金额(保留2位小数)+日期+支付币种+IPS证书

        HttpContext.Current.Response.Write("<form name='pareq' method='post'  action='https://pay.ips.com.cn/ipayment.aspx'/>" +
                                           "<input type='hidden' name='mer_code'  id='mer_code' value='" + Mer_code +
                                           "'><input type='hidden' name='Billno'id='Billno' value='" + Billno +
                                           "'><input type='hidden' name='Gateway_type' id='Gateway_type' value='" + Gateway_Type +
                                           "'><input type='hidden' name='Currency_Type' id='Currency_Type' value='" + Currency_Type +
                                           "'><input type='hidden' name='amount' id='amount' value='" + Amount +
                                           "'><input type='hidden' name='date' id='date' value='" + Date +
                                           "'><input type='hidden' name='attach' id='attach' value='" + Attach +
                                           "'><input type='hidden' name='OrderEncodeType'  id='OrderEncodeType' value='" + OrderEncodeType +
                                           "'><input type='hidden' name='RetEncodeType' id='RetEncodeType' value='" + RetEncodeType +
                                           "'><input type='hidden' name='SignMD5' id='SignMD5'  value='" + SignMD5 +
                                           "'><input type='hidden' name='Merchanturl' id='Merchanturl' value='" + Merchanturl +
                                           "'></form><script language=javascript>document.getElementById('pareq').submit();</script>");
    }
Esempio n. 2
0
    protected void btnAdd_Click(object sender, ImageClickEventArgs e)
    {
        int addrID = WebUnitily.CheckInt(rbListAddr.SelectedValue);

        if (addrID == 0)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("请您选择收货地址!"));
            return;
        }
        L_AcceptAddrInfo addrinfo = new AcceptAddrInfo().GetBindUpdateAcceptAddr(addrID, userID);

        if (addrinfo == null)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您所选择的收货地址不存在!"));
            return;
        }

        L_OrderListInfo olistinfo = new L_OrderListInfo();

        olistinfo.UserID     = userID;
        olistinfo.AcceptName = addrinfo.RealityName;
        olistinfo.AcceptAddr = addrinfo.Province + addrinfo.City + addrinfo.Country + addrinfo.RowAddr;
        olistinfo.HandSet    = addrinfo.HandSet;
        olistinfo.Tel        = addrinfo.Tel;
        olistinfo.ZipCode    = addrinfo.zipCode;

        olistinfo.OrderTime   = DateTime.Now;
        olistinfo.ShippedTime = DateTime.Now;
        olistinfo.OrderState  = 10; //0代表取消订单  10代表等待付款  20代表已付款 30代表已发货
        olistinfo.IsNew       = 0;  //0 新订单 1一查看
        olistinfo.AdminID     = 0;
        olistinfo.OrderID     = userID.ToString() + DateTime.Now.ToString("yyyyMMddmm");

        int exeResult = order.AddUserOrderItem(olistinfo);

        switch (exeResult)
        {
        case 10:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交成功,你需要付款"));
            break;

        case 0:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交成功,你需要付款"));
            break;

        case -2:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的购物车中没有产品,请您选择产品", "UserCard.aspx"));
            break;

        case -3:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您还没有购物车呢,请您先选择产品", "UserCard.aspx"));
            break;

        default:
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", WebUnitily.AlertUrl("您的订单提交失败"));
            break;
        }
        BindDataListShoppingRar();
    }
Esempio n. 3
0
        public int AddUserOrderItem(L_OrderListInfo orderlistinfo)
        {
            SqlParameter[] param = new SqlParameter[13];
            param[0]            = new SqlParameter("@orderID", orderlistinfo.OrderID);
            param[1]            = new SqlParameter("@userID", orderlistinfo.UserID);
            param[2]            = new SqlParameter("@acceptName", orderlistinfo.AcceptName);
            param[3]            = new SqlParameter("@acceptAddr", orderlistinfo.AcceptAddr);
            param[4]            = new SqlParameter("@handset", orderlistinfo.HandSet);
            param[5]            = new SqlParameter("@tel", orderlistinfo.Tel);
            param[6]            = new SqlParameter("@zipCode", orderlistinfo.ZipCode);
            param[7]            = new SqlParameter("@orderTime", orderlistinfo.OrderTime);
            param[8]            = new SqlParameter("@shippedTime", orderlistinfo.ShippedTime);
            param[9]            = new SqlParameter("@orderState", orderlistinfo.OrderState);
            param[10]           = new SqlParameter("@isNew ", orderlistinfo.IsNew);
            param[11]           = new SqlParameter("@adminID", orderlistinfo.AdminID);
            param[12]           = new SqlParameter("@result", SqlDbType.Int);
            param[12].Direction = ParameterDirection.Output;

            SqlHelper.ExecuteNonQuery(CommandType.StoredProcedure, "p_OrderListCreate", param);

            return(Int32.Parse(param[12].Value.ToString()));
        }
Esempio n. 4
0
 public int AddUserOrderItem(L_OrderListInfo orderlistinfo)
 {
     return(order.AddUserOrderItem(orderlistinfo));
 }