コード例 #1
0
        /// <summary>
        /// API付款
        /// </summary>
        ///
        public string cashpay(M_LLPay p)
        {
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("oid_partner", PartnerConfig.OID_PARTNER);
            sParaTemp.Add("api_version", PartnerConfig.CashVERSION);
            // sParaTemp.Add("acct_name", HttpUtility.UrlEncode(p.Acct_name));
            sParaTemp.Add("acct_name", p.Acct_name);
            sParaTemp.Add("card_no", p.Card_no);
            sParaTemp.Add("no_order", p.No_order);
            sParaTemp.Add("dt_order", p.Dt_order);
            sParaTemp.Add("money_order", p.Money_order);
            sParaTemp.Add("flag_card", "0");
            // sParaTemp.Add("info_order", HttpUtility.UrlEncode("P2P投资回款"));
            sParaTemp.Add("info_order", "P2P投资回款");
            sParaTemp.Add("notify_url", PartnerConfig.PAYNOTIFY_URL);
            sParaTemp.Add("city_code", p.City_code);
            sParaTemp.Add("bank_code", p.Bank_code);
            //sParaTemp.Add("brabank_name", HttpUtility.UrlEncode(p.Brabank_name));
            sParaTemp.Add("brabank_name", p.Brabank_name);
            sParaTemp.Add("sign_type", PartnerConfig.CASHSIGN_TYPE);
            string sign = YinTongUtil.addSign(sParaTemp, PartnerConfig.CashTRADER_PRI_KEY, PartnerConfig.MD5_KEY);

            sParaTemp.Add("sign", sign);
            string reqJson = YinTongUtil.dictToJson(sParaTemp);

            YinTongUtil.writelog("付款银行卡卡bin信息查询-请求报文[" + reqJson + "]");



            string responseJSON = postJson(ServerURLConfig.CASHPAY_URL, reqJson);

            return(responseJSON);


            /*
             * SortedDictionary<string, string> sParaTemp = new SortedDictionary<string, string>();
             * sParaTemp.Add("oid_partner", PartnerConfig.OID_PARTNER);
             * sParaTemp.Add("api_version", PartnerConfig.CashVERSION);
             * sParaTemp.Add("acct_name", "张长江");
             * sParaTemp.Add("card_no", "9559980014443530812");
             * sParaTemp.Add("no_order", "20150908120120");
             * sParaTemp.Add("dt_order", "20150908120120");
             * sParaTemp.Add("money_order", "0.05");
             * sParaTemp.Add("flag_card", "0");
             * sParaTemp.Add("info_order", "p2p投资回款");
             * sParaTemp.Add("notify_url", PartnerConfig.PAYNOTIFY_URL);
             * sParaTemp.Add("city_code", "110000");
             * sParaTemp.Add("bank_code", "01030000");
             * sParaTemp.Add("brabank_name", "丽泽桥支行");
             * sParaTemp.Add("sign_type", PartnerConfig.SIGN_TYPE);
             * string sign = YinTongUtil.addSign(sParaTemp, PartnerConfig.TRADER_PRI_KEY, PartnerConfig.MD5_KEY);
             * sParaTemp.Add("sign", sign);
             * string reqJson = YinTongUtil.dictToJson(sParaTemp);
             * YinTongUtil.writelog("银行卡卡bin信息查询-请求报文[" + reqJson + "]");
             * string responseJSON = postJson(ServerURLConfig.CASHPAY_URL, reqJson);
             * return responseJSON;
             */
        }
コード例 #2
0
        /// <summary>
        /// 连连复核处理
        /// </summary>
        /// <param name="LLcashid"></param>
        /// <returns></returns>
        public ActionResult LLCashPay(int LLcashid)
        {
            string str11 = "";

            DataTable dt = getinfo(LLcashid);

            if (dt.Rows.Count > 0)
            {
                string  no_order = dt.Rows[0]["no_order"].ToString();
                M_LLPay m        = new M_LLPay();
                m.Acct_name    = dt.Rows[0]["acct_name"].ToString();
                m.Card_no      = dt.Rows[0]["card_no"].ToString();
                m.No_order     = dt.Rows[0]["no_order"].ToString();
                m.Dt_order     = dt.Rows[0]["dt_order"].ToString();
                m.Money_order  = dt.Rows[0]["money_order"].ToString();
                m.City_code    = dt.Rows[0]["city_code"].ToString();
                m.Bank_code    = dt.Rows[0]["bank_code"].ToString();
                m.Brabank_name = dt.Rows[0]["brabank_name"].ToString();

                string sql = "update  hx_td_LL_cash  set  paystate=5 where  paystate=3  and  no_order='" + no_order + "'";
                DbHelperSQL.RunSql(sql);


                BLL.EF.LLpay llp = new BLL.EF.LLpay();

                string str = llp.cashpay(m);


                //Response.Write(str);

                YinTongUtil.writelog("单个批付及时处理" + no_order + "批付成功  str=" + str);

                var Objlist = JObject.Parse(str);

                if (Objlist["ret_code"].ToString() == "0000")
                {
                    sql = "update  hx_td_LL_cash  set  paystate=1 ,OperTime='" + DateTime.Now.ToString() + "' where  paystate= 5  and  no_order='" + no_order + "'";
                    DbHelperSQL.RunSql(sql);
                    //  CommonOperate.Show_Msg("批付成功");

                    str11 = StringAlert.Alert("批付成功");
                    YinTongUtil.writelog("单个批付及时处理" + no_order + "批付成功  sql=" + sql);
                    Response.End();
                }
                else

                {
                    sql = "update  hx_td_LL_cash  set  paystate=2 ,OperTime='" + DateTime.Now.ToString() + "' where  paystate= 5  and  no_order='" + no_order + "'";
                    DbHelperSQL.RunSql(sql);

                    str11 = StringAlert.Alert("批付失败");
                    //CommonOperate.Show_Msg("批付失败");
                    // Response.End();
                }



                YinTongUtil.writelog("前面处理付款:" + str);
            }



            return(Content(str11));
            // return View();
        }
コード例 #3
0
        public ActionResult LLCashProcessingmore(string str2)
        {
            string json = "";

            if (string.IsNullOrEmpty(str2))
            {
                json = @"{""ret"":0,""msg"":""参数错误""}";
            }
            // json = @"{""ret"":-1,""msg"":""功能待完善""}";

            string bid = str2;

            string[] s = bid.Split(new char[] { ',' });

            string sqllist = "";

            for (int i = 0; i < s.Length; i++)
            {
                if (i == s.Length - 1)
                {
                    sqllist = sqllist + "'" + s[i] + "'";
                }
                else
                {
                    sqllist = sqllist + "'" + s[i] + "',";
                }
            }


            string sql = " select LLcashid,no_order,dt_order,money_order,acct_name,province_code,city_code,brabank_name,ordertime,card_no,paystate,Usrid,BankName,bank_code from V_LL_Cash_User where    LLcashid in (" + sqllist + ")    and  h_state=1 and  paystate=3";

            DataTable dt = DbHelperSQL.GET_DataTable_List(sql);


            int succ = 0, lost = 0;

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                M_LLPay m = new M_LLPay();
                m.Acct_name    = dt.Rows[i]["acct_name"].ToString();
                m.Card_no      = dt.Rows[i]["card_no"].ToString();
                m.No_order     = dt.Rows[i]["no_order"].ToString();
                m.Dt_order     = dt.Rows[i]["dt_order"].ToString();
                m.Money_order  = dt.Rows[i]["money_order"].ToString();
                m.City_code    = dt.Rows[i]["city_code"].ToString();
                m.Bank_code    = dt.Rows[i]["bank_code"].ToString();
                m.Brabank_name = dt.Rows[i]["brabank_name"].ToString();


                sql = "update  hx_td_LL_cash  set  paystate=5  where  paystate=3  and   LLcashid in (" + sqllist + ") ";
                DbHelperSQL.RunSql(sql);

                BLL.EF.LLpay llp = new BLL.EF.LLpay();

                string str = llp.cashpay(m);

                string no_order = dt.Rows[i]["no_order"].ToString();

                var Objlist = JObject.Parse(str);



                if (Objlist["ret_code"].ToString() == "0000")
                {
                    sql = "update  hx_td_LL_cash  set  paystate=1,OperTime='" + DateTime.Now.ToString() + "'  where  paystate=5  and  no_order='" + no_order + "'";
                    DbHelperSQL.RunSql(sql);
                    //  CommonOperate.Show_Msg("批付成功");
                    YinTongUtil.writelog(no_order + "批量批付成功sql=" + sql);

                    succ = succ + 1;
                    //Response.End();
                }
                else
                {
                    //  CommonOperate.Show_Msg("批付失败");
                    sql = "update  hx_td_LL_cash  set  paystate=2,OperTime='" + DateTime.Now.ToString() + "'  where  paystate=5  and  no_order='" + no_order + "'";
                    DbHelperSQL.RunSql(sql);
                    //  CommonOperate.Show_Msg("批付成功");
                    YinTongUtil.writelog(no_order + "批付失败sql=" + sql);

                    lost = lost + 1;
                }


                // Response.Write(dt.Rows[i]["card_no"].ToString() + str + "<br>");


                YinTongUtil.writelog(dt.Rows[i]["card_no"].ToString() + "批处理付款:" + str);
            }

            json = @"{""ret"":1,""msg"":""成功AB笔,失败BB笔""}";
            json = json.Replace("AB", succ.ToString()).Replace("BB", lost.ToString());
            return(Content(json, "text/json"));
        }
コード例 #4
0
        public ActionResult ReLLCash(string no_order, int bu)
        {
            //原页面路径:/admin/ReLLCash.aspx
            string json = "";

            if (string.IsNullOrEmpty(no_order) || bu <= 0)
            {
                json = @"{""ret"":0,""msg"":""参数错误""}";
            }
            if (bu > 0 && no_order != "")
            {
                //生成连连新支付单号
                string LLNew_ordid = YinTongUtil.getCurrentDateTimeStr();

                string sql = " select Acct_name,Card_no,no_order,dt_order,money_order,city_code,bank_code,brabank_name from hx_td_LL_cash where paystate=2  and  no_order='" + no_order + "' ";



                // sql = "  select  OutAcctId,InAcctId,TransAmt from  hx_td_LLpay_re_cash where   htype=0 and h_state=0 and OrdId='" + OrdId + "' and   no_order='" + no_order + "'";

                DataTable dt = DbHelperSQL.GET_DataTable_List(sql);

                if (dt.Rows.Count > 0)
                {
                    string Remarks = "原订单号:" + no_order + " 支付失败 替新订单 " + LLNew_ordid + " 重新支付 <br>";

                    sql = "update  hx_td_LL_cash set  no_order='" + LLNew_ordid + "' ,Remarks='" + Remarks + "'    where   paystate=2  and  no_order='" + no_order + "'";

                    DbHelperSQL.RunSql(sql);

                    sql = " update hx_td_LLpay_re_cash set no_order='" + LLNew_ordid + "'  where htype=1  and  no_order='" + no_order + "'";

                    DbHelperSQL.RunSql(sql);


                    M_LLPay m = new M_LLPay();
                    m.Acct_name    = dt.Rows[0]["acct_name"].ToString();
                    m.Card_no      = dt.Rows[0]["card_no"].ToString();
                    m.No_order     = LLNew_ordid;
                    m.Dt_order     = dt.Rows[0]["dt_order"].ToString();
                    m.Money_order  = dt.Rows[0]["money_order"].ToString();
                    m.City_code    = dt.Rows[0]["city_code"].ToString();
                    m.Bank_code    = dt.Rows[0]["bank_code"].ToString();
                    m.Brabank_name = dt.Rows[0]["brabank_name"].ToString();

                    sql = "update  hx_td_LL_cash  set  paystate=5 where  paystate=2  and  no_order='" + LLNew_ordid + "'";
                    DbHelperSQL.RunSql(sql);

                    BLL.EF.LLpay llp = new BLL.EF.LLpay();

                    string str = llp.cashpay(m);


                    Response.Write(str);

                    YinTongUtil.writelog("单个重新批付及时处理" + no_order + "批付成功  str=" + str);

                    var Objlist = JObject.Parse(str);

                    if (Objlist["ret_code"].ToString() == "0000")
                    {
                        sql = "update  hx_td_LL_cash  set  paystate=1 ,OperTime='" + DateTime.Now.ToString() + "' where  paystate= 5  and  no_order='" + LLNew_ordid + "'";
                        DbHelperSQL.RunSql(sql);

                        json = @"{""ret"":1,""msg"":""重新批付成功""}";
                        // CommonOperate.Show_Msg("重新批付成功 :" + sql);
                        YinTongUtil.writelog("单个重新批付及时处理" + no_order + "批付成功  ");
                        Response.End();
                    }
                    else
                    {
                        sql = "update  hx_td_LL_cash  set  paystate=2 ,OperTime='" + DateTime.Now.ToString() + "' where  paystate= 5  and  no_order='" + LLNew_ordid + "'";
                        DbHelperSQL.RunSql(sql);

                        json = @"{""ret"":0,""msg"":""批付失败""}";
                        //CommonOperate.Show_Msg("批付失败");
                        Response.End();
                    }



                    YinTongUtil.writelog("前面处理付款:" + str);
                }
            }



            //json = @"{""ret"":-1,""msg"":""功能待完善""}";

            return(Content(json, "text/json"));
        }