forked from xiongyuxing/tiku-backend.net
feat: add payment notifications and entitlement fulfillment
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user