Commit 341670f7 authored by 吴春's avatar 吴春

提交支付代码

parent 20287ec3
......@@ -47,6 +47,11 @@ namespace Edu.Common.Enum.Course
/// 耗材出库
/// </summary>
[EnumField("耗材出库")]
SuppliesStockOut = 7
SuppliesStockOut = 7,
/// <summary>
/// 学费收入
/// </summary>
[EnumField("学费收入")]
Tuition = 8
}
}
......@@ -9,7 +9,7 @@ namespace Edu.Common.WeChatPayAPIv3.Model.WxPayCallback
/// <summary>
/// 返回状态码,错误码,SUCCESS为清算机构接收成功,其他错误码为失败。
/// </summary>
public string code { set; get; } = "SUCCESS";
public string code { set; get; } = "FAIL";//"SUCCESS";
/// <summary>
/// 返回信息,如非空,为错误原因。
......
......@@ -20,7 +20,7 @@ namespace Edu.Common.WeChatPayAPIv3.Model
/// 密钥,用商户平台上设置的APIv3密钥【微信商户平台—>账户设置—>API安全—>设置APIv3密钥】,记为key;
/// 官方资料:https://kf.qq.com/faq/180830E36vyQ180830AZFZvu.html
/// </summary>
public static string APIV3Key => "WECHATPAY2-SHA256-RSA2048";
public static string APIV3Key => "8A6453965FB561BC90CC4CB290F26469";
/// <summary>
/// 直连商户的商户号,由微信支付生成并下发。
......
......@@ -79,12 +79,14 @@ namespace Edu.Common.WeChatPayAPIv3
var client = new HttpClient(new WxPayRequestHandler(_mchid, _serialNo, _privateKey));
// var bodyJson = new StringContent(req.ToJson(), Encoding.UTF8, "application/json");
var bodyJson = new StringContent(Common.Plugin.JsonHelper.Serialize(req), Encoding.UTF8, "application/json");
var resp = await client.PostAsync(url, bodyJson);
// 注意!!! 这个resp只是http的结果,需要把接口具体返回的值读取出来,如果接口报错的话,这地方可以看到具体的错误信息,我就是在这里入坑的。
var respStr = await resp.Content.ReadAsStringAsync();
// 如果下单成功,就解析返回的结果,把prepay_id解析出来
// var viewModel = respStr.ToObject<WxPayRespModel>();
Plugin.LogHelper.WriteInfo(respStr);
var viewModel = Common.Plugin.JsonHelper.DeserializeObject<WxPayRespModel>(respStr);
return viewModel;
}
......@@ -99,6 +101,7 @@ namespace Edu.Common.WeChatPayAPIv3
var client = new HttpClient(new WxPayRequestHandler(_mchid, _serialNo, _privateKey));
var resp = await client.GetAsync(url);
var respStr = await resp.Content.ReadAsStringAsync();
Plugin.LogHelper.WriteInfo("查询订单的支付结果信息:"+respStr);
var payModel = Common.Plugin.JsonHelper.DeserializeObject<WxPayStatusRespModel>(respStr);// respStr.ToObject<WxPayStatusRespModel>();
return payModel;
}
......@@ -170,6 +173,7 @@ namespace Edu.Common.WeChatPayAPIv3
var client = new HttpClient(new WxPayRequestHandler(_mchid, _serialNo, _privateKey));
var resp = await client.GetAsync(url);
var respStr = await resp.Content.ReadAsStringAsync();
Plugin.LogHelper.WriteInfo("查询订单的退款结果信息:" + respStr);
var payModel = Common.Plugin.JsonHelper.DeserializeObject<QueryRefundsOrderRespModel>(respStr); //respStr.ToObject<QueryRefundsOrderRespModel>();
return payModel;
}
......
......@@ -71,5 +71,10 @@ namespace Edu.Model.Entity.Course
/// 币种id
/// </summary>
public int CurrencyId { get; set; }
/// <summary>
/// ClientID=74 的时候是学费收款账户id
/// </summary>
public int ClientID { get; set; }
}
}
......@@ -71,7 +71,10 @@ namespace Edu.Module.Course
/// </summary>
private readonly RB_Online_Trade_DetailRepository OnlineTradeDetailRepository = new RB_Online_Trade_DetailRepository();
/// <summary>
/// 财务配置
/// </summary>
private readonly RB_Finance_ConfigRepository finance_ConfigRepository = new RB_Finance_ConfigRepository();
/// <summary>
/// 获取学员信息
......@@ -324,6 +327,19 @@ namespace Edu.Module.Course
#region 合同订单信息
/// <summary>
/// 获取财务配置列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Finance_Config_ViewModel> GetFinanceConfigList(RB_Finance_Config_ViewModel dmodel)
{
return finance_ConfigRepository.GetList(dmodel);
}
/// <summary>
/// 新增合同的付款记录
/// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment