public static string SendRequest(string bill_date, string bill_type, PayConfig config) { WxPayData wxPayData = new WxPayData(); wxPayData.SetValue("bill_date", bill_date); wxPayData.SetValue("bill_type", bill_type); WxPayData wxPayData2 = WxPayApi.DownloadBill(wxPayData, config, 6); return(wxPayData2.ToPrintStr()); }
/// <summary> /// 下载对账单 /// </summary> /// <param name="AdminHotelid"></param> /// <param name="hotelid"></param> /// <param name="bill_date"></param> /// <returns></returns> public static string DownloadBill(string AdminHotelid, int hotelid, string bill_date) { WxPayData data = new WxPayData(); data.SetValue("bill_date", bill_date); //资金账单日期 data.SetValue("bill_type", "ALL"); //账单类型 WxPayData result = WxPayApi.DownloadBill(data, AdminHotelid, hotelid); //提交退款申请给API,接收返回数据 return(result.ToXml()); }
/*** * 下载对账单完整业务流程逻辑 * @param bill_date 下载对账单的日期(格式:20140603,一次只能下载一天的对账单) * @param bill_type 账单类型 * ALL,返回当日所有订单信息,默认值 * SUCCESS,返回当日成功支付的订单 * REFUND,返回当日退款订单 * REVOKED,已撤销的订单 * @return 对账单结果(xml格式) */ public static string Run(string bill_date, string bill_type, string appId) { KMEHosp.Common.LogHelper.WriteInfo("DownloadBill is processing..."); WxPayData data = new WxPayData(); data.SetValue("bill_date", bill_date); //账单日期 data.SetValue("bill_type", bill_type); //账单类型 WxPayData result = WxPayApi.DownloadBill(data, 6, appId); //提交下载对账单请求给API,接收返回结果 KMEHosp.Common.LogHelper.WriteInfo("DownloadBill process complete, result : " + result.ToXml()); return(result.ToPrintStr()); }
/*** * 下载对账单完整业务流程逻辑 * @param bill_date 下载对账单的日期(格式:20140603,一次只能下载一天的对账单) * @param bill_type 账单类型 * ALL,返回当日所有订单信息,默认值 * SUCCESS,返回当日成功支付的订单 * REFUND,返回当日退款订单 * REVOKED,已撤销的订单 * @return 对账单结果(xml格式) */ public static string Run(string bill_date, string bill_type, string AdminHotelid) { Log.Info("DownloadBill", "DownloadBill is processing..."); WxPayData data = new WxPayData(); data.SetValue("bill_date", bill_date); //账单日期 data.SetValue("bill_type", bill_type); //账单类型 WxPayData result = WxPayApi.DownloadBill(data, AdminHotelid); //提交下载对账单请求给API,接收返回结果 Log.Info("DownloadBill", "DownloadBill process complete, result : " + result.ToXml()); return(result.ToPrintStr()); }
/// <summary> /// 下载对帐单 /// </summary> /// <param name="downLoadBill">对帐单请求实体</param> /// <param name="downLoadBillBack">对帐单应答实体</param> /// <param name="message">错误信息</param> /// <returns>交易是否成功</returns> internal bool DownLoadBill(DownLoadBill downLoadBill, out DownLoadBillBack downLoadBillBack, out string message) { _log.Info("下载对账单 DownLoadBill 开始"); var data = new WxPayData(); if (string.IsNullOrEmpty(downLoadBill.Bill_Date) || string.IsNullOrEmpty(downLoadBill.Bill_Type)) { message = "对账单日期,账单类型 不能为空"; _log.Error(message); downLoadBillBack = null; return(false); } data.SetValue("bill_date", downLoadBill.Bill_Date); data.SetValue("bill_type", downLoadBill.Bill_Type); if (!string.IsNullOrEmpty(downLoadBill.Tar_Type)) { data.SetValue("tar_type", downLoadBill.Tar_Type); } //下载对帐单 _log.Info("WxPayApi.DownloadBill"); var result = WxPayApi.DownloadBill(data); _log.Info("DownLoadBill", "DownLoadBill process complete, result : " + result.ToXml()); var return_code = result.GetValue("return_code")?.ToString().ToUpper(); var result_code = result.GetValue("result_code")?.ToString().ToUpper(); if (return_code == null && result_code == null) { _log.Info("下载对账单成功!"); downLoadBillBack = new DownLoadBillBack() { BackData = result.GetValue("result")?.ToString() }; message = ""; return(true); } else { var return_msg = result.GetValue("return_msg"); var err_code_des = result.GetValue("err_code_des"); message = $"{return_msg},{err_code_des}"; _log.Error($"下载对账单失败:{message}"); downLoadBillBack = null; return(false); } }