feat: 支持创建订单时自定义支付宝回调地址
This commit is contained in:
@@ -13,4 +13,6 @@ public class CreateOrderInput
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Required]
|
[Required]
|
||||||
public GoodsTypeEnum GoodsType { get; set; }
|
public GoodsTypeEnum GoodsType { get; set; }
|
||||||
|
|
||||||
|
public string? ReturnUrl{ get; set; }
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,8 @@ public class PayService : ApplicationService, IPayService
|
|||||||
var paymentPageHtml = await _alipayManager.PaymentPageAsync(
|
var paymentPageHtml = await _alipayManager.PaymentPageAsync(
|
||||||
order.GoodsName,
|
order.GoodsName,
|
||||||
order.OutTradeNo,
|
order.OutTradeNo,
|
||||||
order.TotalAmount);
|
order.TotalAmount,
|
||||||
|
input.ReturnUrl);
|
||||||
|
|
||||||
// 3. 返回结果
|
// 3. 返回结果
|
||||||
return new CreateOrderOutput
|
return new CreateOrderOutput
|
||||||
|
|||||||
@@ -10,12 +10,10 @@ namespace Yi.Framework.AiHub.Domain.Alipay;
|
|||||||
public class AlipayManager : DomainService
|
public class AlipayManager : DomainService
|
||||||
{
|
{
|
||||||
private readonly ILogger<AlipayManager> _logger;
|
private readonly ILogger<AlipayManager> _logger;
|
||||||
private readonly IConfiguration _configuration;
|
|
||||||
|
|
||||||
public AlipayManager(ILogger<AlipayManager> logger, IConfiguration configuration)
|
public AlipayManager(ILogger<AlipayManager> logger)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_configuration = configuration;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -24,13 +22,13 @@ public class AlipayManager : DomainService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <exception cref="AlipayException"></exception>
|
/// <exception cref="AlipayException"></exception>
|
||||||
public Task<AlipayTradePagePayResponse> PaymentPageAsync(string productName, string orderNumber,
|
public Task<AlipayTradePagePayResponse> PaymentPageAsync(string productName, string orderNumber,
|
||||||
decimal totalAmount)
|
decimal totalAmount, string? returnUrl)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// 2. 发起API调用(以创建当面付收款二维码为例)
|
// 2. 发起API调用(以创建当面付收款二维码为例)
|
||||||
var response = Factory.Payment.Page()
|
var response = Factory.Payment.Page()
|
||||||
.Pay(productName, orderNumber, totalAmount.ToString(), _configuration["Alipay:ReturnUrl"]);
|
.Pay(productName, orderNumber, totalAmount.ToString(), returnUrl ?? string.Empty);
|
||||||
// 3. 处理响应或异常
|
// 3. 处理响应或异常
|
||||||
if (ResponseChecker.Success(response))
|
if (ResponseChecker.Success(response))
|
||||||
{
|
{
|
||||||
|
|||||||
1
Yi.Ai.Vue3/types/import_meta.d.ts
vendored
1
Yi.Ai.Vue3/types/import_meta.d.ts
vendored
@@ -6,7 +6,6 @@ interface ImportMetaEnv {
|
|||||||
readonly VITE_WEB_ENV: string;
|
readonly VITE_WEB_ENV: string;
|
||||||
readonly VITE_WEB_BASE_API: string;
|
readonly VITE_WEB_BASE_API: string;
|
||||||
readonly VITE_API_URL: string;
|
readonly VITE_API_URL: string;
|
||||||
readonly VITE_BUILD_COMPRESS: string;
|
|
||||||
readonly VITE_SSO_SEVER_URL: string;
|
readonly VITE_SSO_SEVER_URL: string;
|
||||||
readonly VITE_APP_VERSION: string;
|
readonly VITE_APP_VERSION: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user