feat: add payment sdk and tenant secret foundation

This commit is contained in:
xiong
2026-07-26 19:28:04 +08:00
parent 28befc57be
commit 5503d7a644
17 changed files with 16330 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
using System.Text.Json;
using Tiku.Application.Commerce;
namespace Tiku.Infrastructure.Commerce;
internal sealed class ManualPaymentProvider : IPaymentProvider
{
public string Provider => PaymentProviders.Manual;
public Task<CreatePaymentProviderResult> CreatePaymentAsync(
PaymentProviderAccount account,
CreatePaymentProviderRequest request,
CancellationToken cancellationToken = default)
{
var payload = JsonSerializer.SerializeToElement(new
{
request.OrderNo,
request.AmountCents,
request.Subject,
Message = "manual_payment_requires_tenant_admin_confirmation"
});
return Task.FromResult(new CreatePaymentProviderResult(
Provider,
request.Method,
"pending",
null,
payload,
payload));
}
public Task<PaymentNotificationResult> ParsePaymentNotificationAsync(
PaymentProviderAccount account,
PaymentNotificationRequest request,
CancellationToken cancellationToken = default)
{
throw new PaymentProviderException(
"Manual payment does not accept provider notifications.",
"manual_payment_notification_not_supported");
}
}