forked from gongxuegit/tiku-backend.net
feat(platform): add CRM SMS and payment settings
This commit is contained in:
@@ -4,6 +4,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Tiku.Application.Commerce;
|
||||
using Tiku.Application.PlatformBilling;
|
||||
using Tiku.Application.Security;
|
||||
using Tiku.Domain.Platform;
|
||||
using Tiku.Domain.Tenancy;
|
||||
using Tiku.Infrastructure.Persistence;
|
||||
|
||||
@@ -68,8 +69,17 @@ internal sealed class PlatformBillingPaymentGateway(
|
||||
}
|
||||
else
|
||||
{
|
||||
account = await services.GetRequiredService<IPaymentProviderConfigService>()
|
||||
.GetActiveAccountAsync(platformTenantId, normalized, token);
|
||||
var channel = await dbContext.PlatformPaymentChannels.AsNoTracking()
|
||||
.Where(value => value.Provider == normalized && value.Status == PlatformPaymentChannelStatus.Active)
|
||||
.OrderBy(value => value.Priority)
|
||||
.FirstOrDefaultAsync(token)
|
||||
?? throw new PaymentProviderException("Platform payment channel is missing.", "platform_payment_channel_missing");
|
||||
account = new PaymentProviderAccount(
|
||||
platformTenantId,
|
||||
normalized,
|
||||
channel.Mode,
|
||||
channel.ConfigPublic,
|
||||
JsonDocument.Parse("{}").RootElement.Clone());
|
||||
}
|
||||
|
||||
return await operation(resolvedProvider, account, token);
|
||||
|
||||
Reference in New Issue
Block a user