Exemple #1
0
        /// <summary>
        /// 创建支付信息(网页公众号)
        /// </summary>
        /// <param name="request">request</param>
        /// <param name="config">配置</param>
        /// <returns>结果</returns>
        public static WapUnifiedOrderResult CreateDirectWapPayByUser(WapUnifiedOrderRequest request, Config config)
        {
            // 统一下单
            var requestStr         = TenpayUtil.GetUnifiedWapOrderXml(request, config);
            var response           = HttpHelp.PostXmlToUrl(Config.UnifiedPayUrl, requestStr);
            var unifiedOrderResult = TenpayUtil.ConvertToWapUnifiedOrderResult(response);
            // 调起支付
            var parameters = TenpayUtil.GetWapPaySign(unifiedOrderResult, config);
            var result     = TenpayUtil.CreatePayParameters(parameters, unifiedOrderResult);

            return(result);
        }