feat: 支持创建订单时自定义支付宝回调地址
This commit is contained in:
@@ -10,12 +10,10 @@ namespace Yi.Framework.AiHub.Domain.Alipay;
|
||||
public class AlipayManager : DomainService
|
||||
{
|
||||
private readonly ILogger<AlipayManager> _logger;
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public AlipayManager(ILogger<AlipayManager> logger, IConfiguration configuration)
|
||||
public AlipayManager(ILogger<AlipayManager> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -24,13 +22,13 @@ public class AlipayManager : DomainService
|
||||
/// <returns></returns>
|
||||
/// <exception cref="AlipayException"></exception>
|
||||
public Task<AlipayTradePagePayResponse> PaymentPageAsync(string productName, string orderNumber,
|
||||
decimal totalAmount)
|
||||
decimal totalAmount, string? returnUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 2. 发起API调用(以创建当面付收款二维码为例)
|
||||
var response = Factory.Payment.Page()
|
||||
.Pay(productName, orderNumber, totalAmount.ToString(), _configuration["Alipay:ReturnUrl"]);
|
||||
.Pay(productName, orderNumber, totalAmount.ToString(), returnUrl ?? string.Empty);
|
||||
// 3. 处理响应或异常
|
||||
if (ResponseChecker.Success(response))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user