예제 #1
0
        /// <summary>
        /// 支付包支付通道H5调用方式
        /// </summary>
        /// <param name="apptype">应用类型id</param>
        /// <param name="code">订单编号</param>
        /// <param name="goodsname">商品名称</param>
        /// <param name="price">商品价格</param>
        /// <param name="TableName">订单表表名</param>
        /// <returns></returns>
        private InnerResponse PayZfbH5(int apptype, string code, string goodsname, decimal price, int oderid, string IP, int appid)
        {
            InnerResponse inn = new InnerResponse();

            JMP.BLL.jmp_order bll = new JMP.BLL.jmp_order();
            Config            cfg = new Config(apptype, appid);
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            if (!UpdateOrde.OrdeUpdateInfo(oderid, cfg.pay_id))
            {
                inn = inn.ToResponse(ErrorCode.Code101);
                return(inn);
            }
            if (!JudgeMoney.JudgeMinimum(price, cfg.minmun))
            {
                inn = inn.ToResponse(ErrorCode.Code8990);
                return(inn);
            }
            if (!JudgeMoney.JudgeMaximum(price, cfg.maximum))
            {
                inn = inn.ToResponse(ErrorCode.Code8989);
                return(inn);
            }
            sParaTemp.Add("partner", cfg.partner);
            sParaTemp.Add("seller_id", cfg.seller_id);
            sParaTemp.Add("_input_charset", cfg.input_charset.ToLower());
            sParaTemp.Add("service", "alipay.wap.create.direct.pay.by.user");
            sParaTemp.Add("payment_type", "1");
            sParaTemp.Add("sign_type", "RSA");
            sParaTemp.Add("notify_url", ConfigurationManager.AppSettings["TokenUrl"].ToString().Replace("{0}", cfg.pay_id.ToString())); //需要封装TokenUrl(异步回调地址)
            sParaTemp.Add("return_url", ConfigurationManager.AppSettings["GOTOUrl"].ToString().Replace("{0}", oderid.ToString()));      //同步支付成功界面跳转地址
            string overtime = (int.Parse(ConfigurationManager.AppSettings["overtime"].ToString()) / 60) + "m";

            sParaTemp.Add("it_b_pay", overtime);          //订单超时时间
            sParaTemp.Add("out_trade_no", code);          //我们的订单号
            sParaTemp.Add("subject", goodsname);          //商品名称(根据商品id查询商品名称)
            sParaTemp.Add("total_fee", price.ToString()); //价格(已传入的为准,无就从数据库读取)
            sParaTemp.Add("body", goodsname);             //商品名称(备注)
            sParaTemp.Add("app_pay", "Y");                //吊起app
            string httpurl = new Alipay.Submit(apptype, appid).BuildRequestHttp(sParaTemp);

            inn           = inn.ToResponse(ErrorCode.Code100);
            inn.ExtraData = httpurl;//http提交方式;
            inn.IsJump    = true;
            return(inn);
        }
예제 #2
0
        /// <summary>
        /// 条码支付
        /// </summary>
        /// <param name="seller_email">卖家账号</param>
        /// <param name="out_trade_no">系统唯一流水号</param>
        /// <param name="subject">交易名称</param>
        /// <param name="total_fee">金额</param>
        /// <param name="SHOP_ID"></param>
        /// <param name="STORE_TYPE"></param>
        /// <param name="STORE_ID"></param>
        /// <param name="TERMINAL_ID"></param>
        ///<param name="barCode">支付宝当面付条码</param>
        /// <returns></returns>
        public static string BARCODE_PAY_OFFLINE_Ext(string seller_email, string out_trade_no, string subject, string total_fee, string barCode, string STORE_ID, string STORE_TYPE, string TERMINAL_ID, string SHOP_ID)
        {
            ////////////////////////////////////////////请求参数////////////////////////////////////////////

            ////卖家支付宝帐户
            //string seller_email;
            ////必填

            ////商户订单号
            //string out_trade_no ;
            ////商户网站订单系统中唯一订单号,必填

            ////订单名称
            //string subject ;
            ////必填

            ////付款金额
            //string total_fee ;
            //必填

            //订单业务类型
            string product_code = "BARCODE_PAY_OFFLINE";
            //SOUNDWAVE_PAY_OFFLINE:声波支付,FINGERPRINT_FAST_PAY:指纹支付,BARCODE_PAY_OFFLINE:条码支付

            //动态ID类型
            string dynamic_id_type = "barcode";
            //soundwave:声波,qrcode:二维码,barcode:条码

            //动态ID
            //string dynamic_id = Guid .NewGuid ().ToString ().Replace ("-","");
            //例如3856957008a73b7d

            ////////////////////////////////////////////////////////////////////////////////////////////////

            //把请求参数打包成数组
            SortedDictionary <string, string> sParaTemp = new SortedDictionary <string, string>();

            sParaTemp.Add("partner", Config.Partner);
            sParaTemp.Add("_input_charset", Config.Input_charset.ToLower());
            sParaTemp.Add("service", "alipay.acquire.createandpay");
            sParaTemp.Add("seller_email", seller_email);
            sParaTemp.Add("out_trade_no", out_trade_no);
            sParaTemp.Add("subject", subject);
            sParaTemp.Add("total_fee", total_fee);
            sParaTemp.Add("product_code", product_code);
            sParaTemp.Add("dynamic_id_type", dynamic_id_type);
            sParaTemp.Add("dynamic_id", barCode);
            //extend_params
            string extInfo = "{\"AGENT_ID\":\"11864042a1\"";

            if (!string.IsNullOrEmpty(STORE_TYPE))
            {
                extInfo += ",\"STORE_TYPE\":\"" + STORE_TYPE + "\"";
            }

            if (!string.IsNullOrEmpty(SHOP_ID))
            {
                extInfo += ",\"SHOP_ID\":\"" + SHOP_ID + "\"";
            }


            if (!string.IsNullOrEmpty(TERMINAL_ID))
            {
                extInfo += ",\"TERMINAL_ID\":\"" + TERMINAL_ID + "\"";
            }

            if (!string.IsNullOrEmpty(STORE_ID))
            {
                extInfo += ",\"STORE_ID\":\"" + STORE_ID + "\"";
            }

            extInfo += "}";
            sParaTemp.Add("extend_params", extInfo);
            //建立请求
            string sHtmlText = Submit.BuildRequest(sParaTemp);

            return(sHtmlText);
        }