/// <summary> /// 发送请求 /// </summary> protected virtual async Task <string> Request(WechatpayConfig config, WechatpayRefundParameterBuilder builder) { if (IsSend == false) { return(string.Empty); } return(await Web.Client() .Post(config.GetRefundUrl()) .Certificate(config.Certificate, config.CertificatePassword) .XmlData(builder.ToXml()) .ResultAsync()); }
/// <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(); }