Example #1
0
        /// <summary>
        /// 关闭订单 请求参数
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="mchId"></param>
        /// <param name="outTradeNo"></param>
        /// <param name="key"></param>
        /// <param name="nonceStr"></param>
        /// <param name="signType"></param>
        public TenPayV3CloseOrderRequestData(string appId, string mchId, string outTradeNo, string key, string nonceStr,
                                             string signType = "MD5")
        {
            AppId      = appId;
            MchId      = mchId;
            NonceStr   = nonceStr;
            OutTradeNo = outTradeNo;
            SignType   = signType;
            Key        = key;

            #region 设置RequestHandler

            //创建支付应答对象
            PackageRequestHandler = new RequestHandler(null);
            //初始化
            PackageRequestHandler.Init();

            //设置package订单参数
            PackageRequestHandler.SetParameter("appid", this.AppId);             //公众账号ID
            PackageRequestHandler.SetParameter("mch_id", this.MchId);            //商户号
            PackageRequestHandler.SetParameter("out_trade_no", this.OutTradeNo); //填入商家订单号
            PackageRequestHandler.SetParameter("nonce_str", this.NonceStr);      //随机字符串
            Sign = PackageRequestHandler.CreateMd5Sign("key", this.Key);
            PackageRequestHandler.SetParameter("sign", Sign);                    //签名

            #endregion
        }
Example #2
0
        /// <summary>
        /// 企业付款
        /// </summary>
        /// <param name="appId">微信分配的公众账号ID(企业号corpid即为此appId)</param>
        /// <param name="mchId">商户号</param>
        /// <param name="nonceStr">随机字符串</param>
        /// <param name="deviceInfo">微信支付分配的终端设备号</param>
        /// <param name="partnerTradeNo">商户订单号</param>
        /// <param name="openId">用户openid</param>
        /// <param name="key"></param>
        /// <param name="checkName">校验用户姓名选项(NO_CHECK:不校验真实姓名 FORCE_CHECK:强校验真实姓名) </param>
        /// <param name="reUserName">收款用户姓名</param>
        /// <param name="amount">金额(单位:元,小数点后不要超过2位,否则会被四舍五入到分)</param>
        /// <param name="desc">企业付款描述信息</param>
        /// <param name="spbillCreateIP">Ip地址</param>
        /// <param name="wwMsgType">付款消息类型(NORMAL_MSG:普通付款消息 APPROVAL _MSG:审批付款消息)</param>
        /// <param name="approvalNumber">审批单号</param>
        /// <param name="approvalType">审批类型</param>
        /// <param name="actName">项目名称,最长50个utf8字符</param>
        /// <param name="agentId"></param>
        public TenPayV3PayToWorkerRequestData(string appId, string mchId, string secret, string nonceStr, string partnerTradeNo,
                                              string openId, string key, string checkName, string reUserName, decimal amount, string desc, string spbillCreateIP,
                                              string deviceInfo, string actName, string wwMsgType = null, string approvalNumber = null, string approvalType = null, uint?agentId = null)
        {
            AppId          = appId;
            MchId          = mchId;
            Secret         = secret;
            NonceStr       = nonceStr;
            PartnerTradeNo = partnerTradeNo;
            OpenId         = openId;
            CheckName      = checkName;
            ReUserName     = reUserName;
            Amount         = amount;
            Desc           = desc;
            SpbillCreateIP = spbillCreateIP;
            DeviceInfo     = deviceInfo;
            ActName        = actName;
            WwMsgType      = wwMsgType;
            ApprovalNumber = approvalNumber;
            ApprovalType   = approvalType;
            AgentId        = agentId;
            Key            = key;

            #region 设置RequestHandler

            //创建支付应答对象
            PackageRequestHandler = new RequestHandler(null);
            //初始化
            PackageRequestHandler.Init();

            //设置package订单参数
            PackageRequestHandler.SetParameter("appid", this.AppId);                                                          //微信分配的公众账号ID(企业微信corpid即为此appid)
                                                                                                                              //https://work.weixin.qq.com/api/doc#90000/90135/90278
            PackageRequestHandler.SetParameter("mch_id", this.MchId);                                                         //商户号
            PackageRequestHandler.SetParameter("nonce_str", this.NonceStr);                                                   //随机字符串
            PackageRequestHandler.SetParameterWhenNotNull("device_info", this.DeviceInfo);                                    //微信支付分配的终端设备号
            PackageRequestHandler.SetParameter("partner_trade_no", this.PartnerTradeNo);                                      //商户订单号
            PackageRequestHandler.SetParameter("openid", this.OpenId);                                                        //用户openid
            PackageRequestHandler.SetParameter("check_name", this.CheckName);                                                 //校验用户姓名选项
            PackageRequestHandler.SetParameter("re_user_name", this.ReUserName);                                              //收款用户姓名
            PackageRequestHandler.SetParameter("amount", ((int)(this.Amount * 100 + 0.5m)).ToString());                       //金额
            PackageRequestHandler.SetParameter("desc", this.Desc);                                                            //企业付款描述信息
            PackageRequestHandler.SetParameter("spbill_create_ip", this.SpbillCreateIP);                                      //Ip地址
            PackageRequestHandler.SetParameterWhenNotNull("ww_msg_type", this.WwMsgType);                                     //付款消息类型
            PackageRequestHandler.SetParameterWhenNotNull("approval_number", this.ApprovalNumber);                            //审批单号
            PackageRequestHandler.SetParameterWhenNotNull("approval_type", this.ApprovalType);                                //审批类型
            PackageRequestHandler.SetParameter("act_name", this.ActName);                                                     //项目名称
            PackageRequestHandler.SetParameterWhenNotNull("agentid", this.AgentId.HasValue ? this.AgentId.ToString() : null); //项目名称

            //企业微信签名:https://work.weixin.qq.com/api/doc#90000/90135/90281

            var workWxSign = PackageRequestHandler.CreateMd5Sign("secret", this.Secret, WorkPaySignType.WorkPayApi);
            PackageRequestHandler.SetParameter("workwx_sign", workWxSign); //企业微信签名

            Sign = PackageRequestHandler.CreateMd5Sign("key", this.Key);
            PackageRequestHandler.SetParameter("sign", Sign); //签名

            #endregion
        }
Example #3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="mchId"></param>
        /// <param name="subappid">服务商时,子商户公众账号ID</param>
        /// <param name="submchid">服务商时,子商户号</param>
        /// <param name="key"></param>
        /// <param name="nonceStr"></param>
        /// <param name="transactionId">微信支付订单号</param>
        /// <param name="outOrderNo">商户系统内部的分账单号,在商户系统内部唯一(单次分账、多次分账、完结分账应使用不同的商户分账单号),
        /// 同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@
        /// </param>
        /// <param name="receivers">分账接收方列表,此对象通过Json格式传输</param>
        public TenpayV3ProtfitSharingRequestData(
            string appId, string mchId, string subappid, string submchid, string key, string nonceStr,
            string transactionId,
            string outOrderNo,
            TenpayV3ProfitShareingRequestData_ReceiverInfo[] receivers
            )
        {
            AppId     = appId;
            MchId     = mchId;
            NonceStr  = nonceStr;
            Key       = key;
            SubAppId  = subappid;
            SubMchId  = submchid;
            Receivers = receivers;

            if (Receivers == null || Receivers.Length == 0)
            {
                throw new ArgumentNullException("必须指定待分账的接收方列表");
            }
            TransactionId = transactionId;
            OutOrderNo    = outOrderNo;


            #region 设置RequestHandler

            //创建支付应答对象
            PackageRequestHandler = new RequestHandler(null);
            //初始化
            PackageRequestHandler.Init();

            //设置package订单参数
            //以下设置顺序按照官方文档排序,方便维护:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1
            PackageRequestHandler.SetParameter("appid", this.AppId);                    //公众账号ID
            PackageRequestHandler.SetParameter("mch_id", this.MchId);                   //商户号
            PackageRequestHandler.SetParameterWhenNotNull("sub_appid", this.SubAppId);  //子商户公众账号ID
            PackageRequestHandler.SetParameterWhenNotNull("sub_mch_id", this.SubMchId); //子商户号
            PackageRequestHandler.SetParameter("nonce_str", this.NonceStr);             //随机字符串
            PackageRequestHandler.SetParameter("sign_type", this.SignType);             //签名类型,默认为MD5

            PackageRequestHandler.SetParameter("transaction_id", this.TransactionId);   //微信支付订单号
            PackageRequestHandler.SetParameter("out_order_no", this.OutOrderNo);        //商户系统内部的分账单号
            if (Receivers != null)
            {
                JsonSerializerSettings setting = new JsonSerializerSettings();
                setting.NullValueHandling = NullValueHandling.Ignore;
                PackageRequestHandler.SetParameter("receivers", Receivers.ToJson(false, setting));   //分账接收方列表
            }

            Sign = PackageRequestHandler.CreateSha256Sign("key", this.Key);

            PackageRequestHandler.SetParameter("sign", Sign);                              //签名
            #endregion
        }
Example #4
0
        /// <summary>
        /// 服务商
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="mchId"></param>
        /// <param name="subappid">子商户公众账号ID</param>
        /// <param name="submchid">子商户号</param>
        /// <param name="key"></param>
        /// <param name="nonceStr"></param>
        /// <param name="receiver">需要删除的的分账接收方对象</param>
        /// <param name="version">统一下单接口参数,参考:https://pay.weixin.qq.com/wiki/doc/api/danpin.php?chapter=9_203&amp;index=6</param>
        public TenpayV3ProfitShareingRemoveReceiverRequestData(
            string appId, string mchId, string subappid, string submchid, string key, string nonceStr,
            TenpayV3ProfitShareing_ReceiverInfo receiver, string version = null
            )
        {
            AppId    = appId;
            MchId    = mchId;
            NonceStr = nonceStr;
            Key      = key;
            SubAppId = subappid;
            SubMchId = submchid;
            Receiver = receiver;
            Version  = version;
            if (Receiver == null)
            {
                throw new ArgumentNullException("必须指定待删除的分账接收方");
            }


            #region 设置RequestHandler

            //创建支付应答对象
            PackageRequestHandler = new RequestHandler(null);
            //初始化
            PackageRequestHandler.Init();

            //设置package订单参数
            //以下设置顺序按照官方文档排序,方便维护:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1

            PackageRequestHandler.SetParameterWhenNotNull("version", Version);
            PackageRequestHandler.SetParameter("appid", this.AppId);                        //公众账号ID
            PackageRequestHandler.SetParameter("mch_id", this.MchId);                       //商户号
            PackageRequestHandler.SetParameterWhenNotNull("sub_appid", this.SubAppId);      //子商户公众账号ID
            PackageRequestHandler.SetParameterWhenNotNull("sub_mch_id", this.SubMchId);     //子商户号
            PackageRequestHandler.SetParameter("nonce_str", this.NonceStr);                 //随机字符串
            PackageRequestHandler.SetParameter("sign_type", this.SignType);                 //签名类型,默认为MD5

            JsonSerializerSettings setting = new JsonSerializerSettings();
            setting.NullValueHandling = NullValueHandling.Ignore;
            PackageRequestHandler.SetParameter("receiver", Receiver.ToJson(false, setting));//场景信息

            Sign = PackageRequestHandler.CreateSha256Sign("key", this.Key);

            PackageRequestHandler.SetParameter("sign", Sign);                               //签名
            #endregion
        }
        /// <summary>
        /// 企业付款
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="appid">公众账号appid</param>
        /// <param name="mchId">商户号</param>
        /// <param name="deviceInfo">设备号</param>
        /// <param name="nonceStr">随机字符串</param>
        /// <param name="outTradeNo">商户订单号</param>
        /// <param name="openId">用户openid</param>
        /// <param name="key"></param>
        /// <param name="checkName">校验用户姓名选项</param>
        /// <param name="reUserName">收款用户姓名</param>
        /// <param name="amount">金额(单位:元,小数点后不要超过2位,否则会被四舍五入到分)</param>
        /// <param name="desc">企业付款描述信息</param>
        /// <param name="spbillCreateIP">Ip地址</param>
        /// <param name="subAppId"></param>
        /// <param name="subMchId"></param>
        public TenPayV3TransfersRequestData(string appId, string mchId, string deviceInfo, string nonceStr, string outTradeNo, string openId, string key, string checkName,
                                            string reUserName, decimal amount, string desc, string spbillCreateIP, string subAppId = null, string subMchId = null)
        {
            AppId          = appId;
            SubAppId       = subAppId;
            MchId          = mchId;
            SubMchId       = subMchId;
            DeviceInfo     = deviceInfo;
            NonceStr       = nonceStr;
            OutTradeNo     = outTradeNo;
            OpenId         = openId;
            CheckName      = checkName;
            ReUserName     = reUserName;
            Amount         = amount;
            Desc           = desc;
            SpbillCreateIP = spbillCreateIP;
            Key            = key;

            #region 设置RequestHandler

            //创建支付应答对象
            PackageRequestHandler = new RequestHandler(null);
            //初始化
            PackageRequestHandler.Init();

            //设置package订单参数
            PackageRequestHandler.SetParameter("mch_appid", this.AppId);                                //公众账号ID
            PackageRequestHandler.SetParameterWhenNotNull("sub_appid", this.SubAppId);                  //子商户公众账号ID
            PackageRequestHandler.SetParameter("mchid", this.MchId);                                    //商户号
            PackageRequestHandler.SetParameterWhenNotNull("sub_mch_id", this.SubMchId);                 //子商户号
            //https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2
            PackageRequestHandler.SetParameter("device_info", this.DeviceInfo);                         //终端设备号
            PackageRequestHandler.SetParameter("nonce_str", this.NonceStr);                             //随机字符串
            PackageRequestHandler.SetParameter("partner_trade_no", this.OutTradeNo);                    //商户订单号
            PackageRequestHandler.SetParameter("openid", this.OpenId);                                  //用户openid
            PackageRequestHandler.SetParameter("check_name", this.CheckName);                           //校验用户姓名选项
            PackageRequestHandler.SetParameter("re_user_name", this.ReUserName);                        //收款用户姓名
            PackageRequestHandler.SetParameter("amount", ((int)(this.Amount * 100 + 0.5m)).ToString()); //金额
            PackageRequestHandler.SetParameter("desc", this.Desc);                                      //企业付款描述信息
            PackageRequestHandler.SetParameter("spbill_create_ip", this.SpbillCreateIP);                //Ip地址
            Sign = PackageRequestHandler.CreateMd5Sign("key", this.Key);
            PackageRequestHandler.SetParameter("sign", Sign);                                           //签名

            #endregion
        }
Example #6
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="mchId"></param>
        /// <param name="subappid">服务商时,子商户公众账号ID</param>
        /// <param name="submchid">服务商时,子商户号</param>
        /// <param name="key"></param>
        /// <param name="nonceStr"></param>
        /// <param name="transactionId">微信支付订单号</param>
        /// <param name="outOrderNo">商户系统内部的分账单号,在商户系统内部唯一(单次分账、多次分账、完结分账应使用不同的商户分账单号),
        /// 同一分账单号多次请求等同一次。只能是数字、大小写字母_-|*@
        /// </param>
        /// <param name="description">分账完结的原因描述 </param>
        public TenpayV3ProtfitSharingFinishRequestData(
            string appId, string mchId, string subappid, string submchid, string key, string nonceStr,
            string transactionId,
            string outOrderNo,
            string description
            )
        {
            AppId       = appId;
            MchId       = mchId;
            NonceStr    = nonceStr;
            Key         = key;
            SubAppId    = subappid;
            SubMchId    = submchid;
            Description = description;

            TransactionId = transactionId;
            OutOrderNo    = outOrderNo;


            #region 设置RequestHandler

            //创建支付应答对象
            PackageRequestHandler = new RequestHandler(null);
            //初始化
            PackageRequestHandler.Init();

            //设置package订单参数
            //以下设置顺序按照官方文档排序,方便维护:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1
            PackageRequestHandler.SetParameter("appid", this.AppId);                    //公众账号ID
            PackageRequestHandler.SetParameter("mch_id", this.MchId);                   //商户号
            PackageRequestHandler.SetParameterWhenNotNull("sub_appid", this.SubAppId);  //子商户公众账号ID
            PackageRequestHandler.SetParameterWhenNotNull("sub_mch_id", this.SubMchId); //子商户号
            PackageRequestHandler.SetParameter("nonce_str", this.NonceStr);             //随机字符串
            PackageRequestHandler.SetParameter("sign_type", this.SignType);             //签名类型

            PackageRequestHandler.SetParameter("transaction_id", this.TransactionId);   //微信支付订单号
            PackageRequestHandler.SetParameter("out_order_no", this.OutOrderNo);        //商户系统内部的分账单号
            PackageRequestHandler.SetParameter("description", this.Description);        //商户系统内部的分账单号


            Sign = PackageRequestHandler.CreateSha256Sign("key", this.Key);

            PackageRequestHandler.SetParameter("sign", Sign);                              //签名
            #endregion
        }
        /// <summary>
        /// 关闭订单 请求参数
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="mchId"></param>
        /// <param name="outTradeNo"></param>
        /// <param name="key"></param>
        /// <param name="nonceStr"></param>
        /// <param name="signType"></param>
        public TenPayV3GetSignKeyRequestData(string mchId, string nonceStr, string key, string signType = "MD5")
        {
            MchId    = mchId;
            NonceStr = nonceStr;
            SignType = signType;
            Key      = key;

            #region 设置RequestHandler

            //创建支付应答对象
            PackageRequestHandler = new RequestHandler(null);
            //初始化
            PackageRequestHandler.Init();

            //设置package订单参数
            PackageRequestHandler.SetParameter("mch_id", this.MchId);       //商户号
            PackageRequestHandler.SetParameter("nonce_str", this.NonceStr); //随机字符串
            Sign = PackageRequestHandler.CreateMd5Sign("key", this.Key);
            PackageRequestHandler.SetParameter("sign", Sign);               //签名

            #endregion
        }
        /// <summary>
        /// 服务商
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="mchId"></param>
        /// <param name="subappid">子商户公众账号ID</param>
        /// <param name="submchid">子商户号</param>
        /// <param name="body"></param>
        /// <param name="outTradeNo"></param>
        /// <param name="totalFee">单位:分</param>
        /// <param name="spbillCreateIp"></param>
        /// <param name="notifyUrl"></param>
        /// <param name="tradeType"></param>
        /// <param name="openid">trade_type=NATIVE时,OpenId应该为null</param>
        /// <param name="subOpenid">用户子标识,不需要则填写null</param>
        /// <param name="key"></param>
        /// <param name="nonceStr"></param>
        /// <param name="deviceInfo">自定义参数,可以为终端设备号(门店号或收银设备ID),PC网页或公众号内支付可以传"WEB",String(32)如:013467007045764</param>
        /// <param name="timeStart">订单生成时间,如果为空,则默认为当前服务器时间</param>
        /// <param name="timeExpire">订单失效时间,留空则不设置失效时间</param>
        /// <param name="detail">商品详细列表</param>
        /// <param name="attach">附加数据</param>
        /// <param name="feeType">符合ISO 4217标准的三位字母代码,默认人民币:CNY</param>
        /// <param name="goodsTag">商品标记,使用代金券或立减优惠功能时需要的参数,说明详见代金券或立减优惠。String(32),如:WXG</param>
        /// <param name="productId">trade_type=NATIVE时(即扫码支付),此参数必传。此参数为二维码中包含的商品ID,商户自行定义。String(32),如:12235413214070356458058</param>
        /// <param name="limitPay">是否限制用户不能使用信用卡支付</param>
        /// <param name="sceneInfo">场景信息。该字段用于上报场景信息,目前支持上报实际门店信息。</param>
        /// <param name="profitSharing">
        /// 是否需要分账
        /// https://pay.weixin.qq.com/wiki/doc/api/allocation_sl.php?chapter=24_3&index=3
        /// https://pay.weixin.qq.com/wiki/doc/api/allocation.php?chapter=26_3
        /// "Y" -- 需要分账, null 或者 "N"-不需要分账,
        /// 服务商需要在 产品中心--特约商户授权产品 申请特约商户授权,
        /// 并且特约商户需要在 产品中心-我授权的商品中给服务商授权才可以使用分账功能;
        /// 普通商户需要 产品中心-我的产品 中开通分账功能;
        /// </param>
        public TenPayV3UnifiedorderRequestData(
            string appId, string mchId, string subappid, string submchid, string body, string outTradeNo, int totalFee, string spbillCreateIp,
            string notifyUrl, TenPayV3Type tradeType, string openid, string subOpenid, string key, string nonceStr,
            string deviceInfo = null, DateTimeOffset?timeStart = null, DateTime?timeExpire = null,
            string detail     = null, string attach = null, string feeType = "CNY", string goodsTag = null,
            string productId  = null, bool limitPay = false,
            TenPayV3UnifiedorderRequestData_SceneInfo sceneInfo = null,
            string profitSharing = null
            )
        {
            AppId          = appId;
            MchId          = mchId;
            DeviceInfo     = deviceInfo;
            NonceStr       = nonceStr;
            SignType       = "MD5";
            Body           = body ?? "Senparc TenpayV3";
            Detail         = detail;
            Attach         = attach;
            OutTradeNo     = outTradeNo;
            FeeType        = feeType;
            TotalFee       = totalFee;
            SpbillCreateIP = spbillCreateIp;
            TimeStart      = (timeStart ?? SystemTime.Now).ToString("yyyyMMddHHmmss");
            TimeExpire     = timeExpire.HasValue ? timeExpire.Value.ToString("yyyyMMddHHmmss") : null;
            GoodsTag       = goodsTag;
            NotifyUrl      = notifyUrl;
            TradeType      = tradeType;
            ProductId      = productId;
            LimitPay       = limitPay ? "no_credit" : null;
            OpenId         = openid;
            Key            = key;
            SubAppId       = subappid;
            SubMchId       = submchid;
            SubOpenid      = subOpenid;
            SceneInfo      = sceneInfo;
            ProfitSharing  = profitSharing;


            #region 设置RequestHandler

            //创建支付应答对象
            PackageRequestHandler = new RequestHandler(null);
            //初始化
            PackageRequestHandler.Init();

            //设置package订单参数
            //以下设置顺序按照官方文档排序,方便维护:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1
            PackageRequestHandler.SetParameter("version", Register.TenpayV3ProtfitRequestDataVersion);
            PackageRequestHandler.SetParameter("appid", this.AppId);                             //公众账号ID
            PackageRequestHandler.SetParameter("mch_id", this.MchId);                            //商户号
            PackageRequestHandler.SetParameterWhenNotNull("sub_appid", this.SubAppId);           //子商户公众账号ID
            PackageRequestHandler.SetParameterWhenNotNull("sub_mch_id", this.SubMchId);          //子商户号
            PackageRequestHandler.SetParameterWhenNotNull("device_info", this.DeviceInfo);       //自定义参数
            PackageRequestHandler.SetParameter("nonce_str", this.NonceStr);                      //随机字符串
            PackageRequestHandler.SetParameterWhenNotNull("sign_type", this.SignType);           //签名类型,默认为MD5
            PackageRequestHandler.SetParameter("body", this.Body);                               //商品信息
            PackageRequestHandler.SetParameterWhenNotNull("detail", this.Detail);                //商品详细列表
            PackageRequestHandler.SetParameterWhenNotNull("attach", this.Attach);                //附加数据
            PackageRequestHandler.SetParameter("out_trade_no", this.OutTradeNo);                 //商家订单号
            PackageRequestHandler.SetParameterWhenNotNull("fee_type", this.FeeType);             //符合ISO 4217标准的三位字母代码,默认人民币:CNY
            PackageRequestHandler.SetParameter("total_fee", this.TotalFee.ToString());           //商品金额,以分为单位(money * 100).ToString()
            PackageRequestHandler.SetParameter("spbill_create_ip", this.SpbillCreateIP);         //用户的公网ip,不是商户服务器IP
            PackageRequestHandler.SetParameterWhenNotNull("time_start", this.TimeStart);         //订单生成时间
            PackageRequestHandler.SetParameterWhenNotNull("time_expire", this.TimeExpire);       //订单失效时间
            PackageRequestHandler.SetParameterWhenNotNull("goods_tag", this.GoodsTag);           //商品标记
            PackageRequestHandler.SetParameter("notify_url", this.NotifyUrl);                    //接收财付通通知的URL
            PackageRequestHandler.SetParameter("trade_type", this.TradeType.ToString());         //交易类型
            PackageRequestHandler.SetParameterWhenNotNull("product_id", this.ProductId);         //trade_type=NATIVE时(即扫码支付),此参数必传。
            PackageRequestHandler.SetParameterWhenNotNull("limit_pay", this.LimitPay);           //上传此参数no_credit--可限制用户不能使用信用卡支付
            PackageRequestHandler.SetParameterWhenNotNull("openid", this.OpenId);                //用户的openId,trade_type=JSAPI时(即公众号支付),此参数必传
            PackageRequestHandler.SetParameterWhenNotNull("sub_openid", this.SubOpenid);         //用户子标识
            PackageRequestHandler.SetParameterWhenNotNull("profit_sharing", this.ProfitSharing); //是否需要分账标识
            if (SceneInfo != null)
            {
                PackageRequestHandler.SetParameter("scene_info", SceneInfo.ToString());   //场景信息
            }

            Sign = PackageRequestHandler.CreateMd5Sign("key", this.Key);

            PackageRequestHandler.SetParameter("sign", Sign);                              //签名
            #endregion
        }