feat(postit): add native PayPal subscription page
Add bearer-authenticated subscription checkout, reconciliation and cancellation on the authority host, reuse web subscription services, and document the flow with regression tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
993f1bfadb
commit
7cda466fa8
21 changed files with 774 additions and 28 deletions
26
src/Yavsc.Abstract/Resources/ResourceSubscriptionDtos.cs
Normal file
26
src/Yavsc.Abstract/Resources/ResourceSubscriptionDtos.cs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#nullable enable
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Abstract.Resources;
|
||||
|
||||
/// <summary>Monthly resource offer configured by the instance.</summary>
|
||||
public sealed record ResourceSubscriptionOfferResponse(string Pack, string Name, decimal PriceExcludingTax,
|
||||
decimal VatPercent, decimal PriceIncludingTax, decimal MonthlyPoints, int DiskQuotaMultiplier, bool Available);
|
||||
|
||||
/// <summary>Subscription status without merchant credentials or PayPal identifiers.</summary>
|
||||
public sealed record ResourceSubscriptionResponse(Guid Id, string Pack, string State,
|
||||
decimal PriceIncludingTax, decimal MonthlyPoints, DateTimeOffset? NextBillingAt);
|
||||
|
||||
/// <summary>Current user's subscription catalogue, history and resource balance.</summary>
|
||||
public sealed record ResourceSubscriptionsResponse(IReadOnlyList<ResourceSubscriptionOfferResponse> Offers,
|
||||
IReadOnlyList<ResourceSubscriptionResponse> Subscriptions, ResourceUsageSummary Usage);
|
||||
|
||||
/// <summary>Chooses a server-priced monthly pack; amounts are never supplied by the client.</summary>
|
||||
public sealed record CreateResourceSubscriptionRequest
|
||||
{
|
||||
[Required, RegularExpression("^(Discovery|Premium)$")]
|
||||
public required string Pack { get; init; }
|
||||
}
|
||||
|
||||
/// <summary>Prepared subscription and optional PayPal approval link; not proof of payment.</summary>
|
||||
public sealed record ResourceSubscriptionCheckoutResponse(ResourceSubscriptionResponse Subscription, string? ApprovalUrl);
|
||||
Loading…
Reference in a new issue