feat: add payment notifications and entitlement fulfillment

This commit is contained in:
xiong
2026-07-26 19:38:53 +08:00
parent 494039973d
commit 36b64dcf70
6 changed files with 570 additions and 13 deletions

View File

@@ -64,6 +64,13 @@ public sealed record CurrentEntitlementItem(
string Status,
int? DaysLeft);
public sealed record PaymentNotificationProcessResult(
string Provider,
string EventId,
string OrderNo,
string Status,
bool Idempotent);
public interface ICommerceService
{
Task<CommerceOrderItem> CreateOrderAsync(
@@ -89,6 +96,14 @@ public interface ICommerceService
Task<CurrentEntitlementItem> GetCurrentEntitlementAsync(
CommerceActor actor,
CancellationToken cancellationToken = default);
Task<PaymentNotificationProcessResult> ProcessPaymentNotificationAsync(
Guid tenantId,
string provider,
IReadOnlyDictionary<string, string> headers,
string rawBody,
JsonElement body,
CancellationToken cancellationToken = default);
}
public sealed class CommerceException(string message, string code) : Exception(message)