Esempio n. 1
0
        /// <summary>
        /// Navite 下单请求
        /// </summary>
        /// <param name="outTradeNo">商户订单号</param>
        /// <param name="title">商品或支付单简要描述</param>
        /// <param name="totalFee">订单总金额,单位为分</param>
        /// <param name="notifyUrl">接收微信支付异步通知回调地址,通知url必须为直接可访问的url,不能携带参数。</param>
        /// <returns></returns>
        public UnifiedorderNavite CreateUnifiedorderNative(string outTradeNo, string title, int totalFee, string notifyUrl)
        {
            var result = new Data.UnifiedorderRequest(Config.AppId, Config.MchId, outTradeNo, title, totalFee, notifyUrl)
            {
                trade_type = "NATIVE"
            };

            return(new UnifiedorderNavite(Config, result));
        }
Esempio n. 2
0
        /// <summary>
        /// 公众号支付下单请求
        /// </summary>
        /// <param name="outTradeNo">商户订单号</param>
        /// <param name="title">商品或支付单简要描述</param>
        /// <param name="totalFee">订单总金额,单位为分</param>
        /// <param name="notifyUrl">接收微信支付异步通知回调地址,通知url必须为直接可访问的url,不能携带参数。</param>
        /// <param name="openId">用户在商户appid下的唯一标识</param>
        /// <returns></returns>
        public UnifiedorderJsapi CreateUnifiedorderJsapi(string outTradeNo, string title, int totalFee, string notifyUrl, string openId)
        {
            if (string.IsNullOrEmpty(openId))
            {
                throw new ArgumentNullException("openId");
            }

            var result = new Data.UnifiedorderRequest(Config.AppId, Config.MchId, outTradeNo, title, totalFee, notifyUrl)
            {
                trade_type = "JSAPI",
                openid     = openId
            };

            return(new UnifiedorderJsapi(Config, result));
        }
 /// <summary>
 /// 创建
 /// </summary>
 /// <param name="config"></param>
 /// <param name="request"></param>
 public UnifiedorderJsapi(IConfig config, Data.UnifiedorderRequest request)
     : base(config, request)
 {
 }
 /// <summary>
 /// 创建
 /// </summary>
 /// <param name="config"></param>
 /// <param name="request"></param>
 public Unifiedorder(IConfig config, Data.UnifiedorderRequest request)
 {
     Config  = config ?? throw new ArgumentNullException("config");
     Request = request ?? throw new ArgumentNullException("request");
 }