/// <summary> /// 写日志 /// </summary> protected void WriteLog(WechatpayConfig config, WechatpayParameterBuilder builder, WechatpayResult result) { Logger.Error(GetType().FullName + " 微信支付:" + $"支付方式 : {EnumUtil.GetEnumDescription(GetPayWay())}" + $"支付网关 : {config.GetOrderUrl()}" + "请求参数:" + builder.ToXml() + "返回结果:" + result.GetParams() + "原始请求:" + builder.ToString() + "原始响应: " + result.Raw ); }
/// <summary> /// 写日志 /// </summary> protected void WriteLog(WechatpayConfig config, WechatpayRefundParameterBuilder builder, WechatpayResult result) { var log = GetLog(); if (log.IsTraceEnabled == false) { return; } log.Class(GetType().FullName) .Caption("微信退款") .Content($"退款Api地址 : {config.GetRefundUrl()}") .Content("请求参数:") .Content(builder.ToXml()) .Content() .Content("返回结果:") .Content(result.GetParams()) .Content() .Content("原始响应: ") .Content(result.Raw) .Trace(); }
/// <summary> /// 写日志 /// </summary> /// <param name="config">微信支付配置</param> /// <param name="builder">微信支付参数生成器</param> /// <param name="result">微信支付结果</param> protected void WriteLog(WechatpayConfig config, WechatpayParameterBuilder builder, WechatpayResult result) { var log = GetLog(); if (log.IsTraceEnabled == false) { return; } log.Class(GetType().FullName) .Caption("微信支付") .Content($"支付方式 : {GetPayWay().Description()}") .Content($"支付网关 : {config.GetOrderUrl()}") .Content("请求参数:") .Content(builder.ToXml()) .Content() .Content("返回结果:") .Content(result.GetParams()) .Content() .Content("原始响应: ") .Content(result.Raw) .Trace(); }
/// <summary> /// 获取参数集合 /// </summary> public IDictionary <string, string> GetParams() { Init(); return(_result.GetParams()); }
/// <summary> /// 获取结果 /// </summary> /// <param name="config">微信支付配置</param> /// <param name="builder">微信支付参数生成器</param> /// <param name="result">微信支付结果</param> /// <returns></returns> protected override string GetResult(WechatpayConfig config, WechatpayParameterBuilder builder, WechatpayResult result) { return(result.GetParams().ToJson()); }