|
|
@@ -1,7 +1,7 @@
|
|
|
-using System.Security.Cryptography;
|
|
|
-using System.Threading.Tasks;
|
|
|
+using System.Threading.Tasks;
|
|
|
using Essensoft.AspNetCore.Payment.QPay;
|
|
|
using Essensoft.AspNetCore.Payment.QPay.Request;
|
|
|
+using Essensoft.AspNetCore.Payment.Security;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
using WebApplicationSample.Models;
|
|
|
|
|
|
@@ -305,65 +305,66 @@ namespace WebApplicationSample.Controllers
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 对账单下载
|
|
|
+ /// 企业付款
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet]
|
|
|
- public IActionResult StatementDown()
|
|
|
+ public IActionResult B2CPay()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// 对账单下载
|
|
|
+ /// 企业付款
|
|
|
/// </summary>
|
|
|
/// <param name="viewModel"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<IActionResult> StatementDown(QPayStatementDownViewModel viewModel)
|
|
|
+ public async Task<IActionResult> B2CPay(QPayB2CPayViewModel viewModel)
|
|
|
{
|
|
|
- var request = new QPayStatementDownRequest
|
|
|
+ var request = new QPayEPayB2CRequest
|
|
|
{
|
|
|
- BillDate = viewModel.BillDate,
|
|
|
- BillType = viewModel.BillType,
|
|
|
- TarType = viewModel.TarType
|
|
|
+ OpenId = viewModel.OpenId,
|
|
|
+ Uin = viewModel.Uin,
|
|
|
+ OutTradeNo = viewModel.OutTradeNo,
|
|
|
+ TotalFee = viewModel.TotalFee,
|
|
|
+ Memo = viewModel.Memo,
|
|
|
+ CheckRealName = viewModel.CheckRealName,
|
|
|
+ OpUserId = viewModel.OpUserId,
|
|
|
+ OpUserPasswd = MD5.Compute(viewModel.OpUserPasswd),
|
|
|
+ SpbillCreateIp = viewModel.SpbillCreateIp,
|
|
|
+ NotifyUrl = viewModel.NotifyUrl,
|
|
|
};
|
|
|
- var response = await _client.ExecuteAsync(request);
|
|
|
+ var response = await _client.ExecuteAsync(request, "qpayCertificateName");
|
|
|
ViewData["response"] = response.Body;
|
|
|
return View();
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
- /// 企业付款
|
|
|
+ /// 对账单下载
|
|
|
/// </summary>
|
|
|
/// <returns></returns>
|
|
|
[HttpGet]
|
|
|
- public IActionResult B2CPay()
|
|
|
+ public IActionResult StatementDown()
|
|
|
{
|
|
|
return View();
|
|
|
}
|
|
|
+
|
|
|
/// <summary>
|
|
|
- /// 企业付款
|
|
|
+ /// 对账单下载
|
|
|
/// </summary>
|
|
|
/// <param name="viewModel"></param>
|
|
|
/// <returns></returns>
|
|
|
[HttpPost]
|
|
|
- public async Task<IActionResult> B2CPay(QPayB2CPayViewModel viewModel)
|
|
|
+ public async Task<IActionResult> StatementDown(QPayStatementDownViewModel viewModel)
|
|
|
{
|
|
|
- var request = new QPayEPayB2CRequest
|
|
|
+ var request = new QPayStatementDownRequest
|
|
|
{
|
|
|
- OutTradeNo = viewModel.OutTradeNo,
|
|
|
- TotalFee = viewModel.TotalFee,
|
|
|
- SpbillCreateIp = viewModel.SpbillCreateIp,
|
|
|
- NotifyUrl = viewModel.NotifyUrl,
|
|
|
- AppId = viewModel.AppId,
|
|
|
- Memo = viewModel.Memo,
|
|
|
- OpenId = viewModel.OpenId,
|
|
|
- OpUserId = viewModel.OpUserId,
|
|
|
- OpUserPasswd= Essensoft.AspNetCore.Payment.Security.MD5.Compute(viewModel.OpUserPasswd),
|
|
|
- CheckRealName="1",
|
|
|
- Uin= viewModel.Uin
|
|
|
+ BillDate = viewModel.BillDate,
|
|
|
+ BillType = viewModel.BillType,
|
|
|
+ TarType = viewModel.TarType
|
|
|
};
|
|
|
- var response = await _client.ExecuteAsync(request,"test");
|
|
|
+ var response = await _client.ExecuteAsync(request);
|
|
|
ViewData["response"] = response.Body;
|
|
|
return View();
|
|
|
}
|