@breadstone/archipel-platform-payments
Classes
| Class | Description |
|---|---|
| FeatureAccessPort | Abstract port for checking and recording feature usage. Consuming projects must provide a concrete implementation (e.g. backed by Prisma with subscription + usage tables) and register it via PaymentModule.register(). |
| FeatureGuard | Guard that checks if the user has access to a specific feature by delegating to the registered FeatureAccessPort. |
| FeatureUsageInterceptor | Interceptor that records feature usage after successful request handling. Delegates recording to the registered FeatureAccessPort. |
| LemonSqueezyClient | LemonSqueezy implementation of the PaymentClientPort. Uses the official @lemonsqueezy/lemonsqueezy.js SDK. |
| MollieClient | Mollie implementation of the PaymentClientPort. Uses the official @mollie/api-client to interact with the Mollie API. |
| PaddleClient | Paddle implementation of the PaymentClientPort. Uses the official @paddle/paddle-node-sdk to interact with the Paddle Billing API. |
| PaymentClientPort | Abstract port for payment provider clients. Each provider (Stripe, Paddle, LemonSqueezy, Mollie) must implement this contract so that the consuming application can switch providers without changing business logic. |
| PaymentModule | NestJS module providing generic payment infrastructure. Exposes a configurable payment client, a feature-gating guard, and a usage-tracking interceptor. The specific payment provider (Stripe, Paddle, LemonSqueezy, Mollie) is selected via the options. |
| StripeClient | Stripe implementation of the PaymentClientPort. All Stripe-specific types and logic are encapsulated here. |
Interfaces
| Interface | Description |
|---|---|
| IFeatureAccessResult | Result of a feature access check. |
| INormalizedCheckoutSession | Normalized checkout session. |
| INormalizedPrice | Normalized price information. |
| INormalizedSubscription | Normalized subscription. |
| INormalizedWebhookEvent | Normalized webhook event. |
| IPaymentModuleOptions | Configuration options for the PaymentModule. |
Type Aliases
| Type Alias | Description |
|---|---|
| SubscriptionStatus | Normalized subscription status values. |
Variables
| Variable | Description |
|---|---|
| FEATURE_KEY_METADATA | - |
| LEMONSQUEEZY_API_KEY | LemonSqueezy API key. |
| LEMONSQUEEZY_CONFIG_ENTRIES | Configuration entries required by the LemonSqueezy payment provider. |
| LEMONSQUEEZY_STORE_ID | LemonSqueezy store ID. |
| LEMONSQUEEZY_WEBHOOK_SECRET | LemonSqueezy webhook signing secret. |
| MOLLIE_API_KEY | Mollie API key. |
| MOLLIE_CONFIG_ENTRIES | Configuration entries required by the Mollie payment provider. |
| MOLLIE_WEBHOOK_SECRET | Mollie webhook secret for verifying webhook payloads. |
| PADDLE_API_KEY | Paddle API key. |
| PADDLE_CONFIG_ENTRIES | Configuration entries required by the Paddle payment provider. |
| PADDLE_ENVIRONMENT | Paddle environment (production or sandbox). Defaults to production. |
| PADDLE_WEBHOOK_SECRET | Paddle webhook secret key. |
| STRIPE_API_KEY | Stripe secret API key. |
| STRIPE_CONFIG_ENTRIES | Configuration entries required by the Stripe payment provider. |
| STRIPE_WEBHOOK_SECRET | Stripe webhook signing secret. |
Functions
| Function | Description |
|---|---|
| RequiresFeature | Decorator to mark endpoints that require feature access check. The featureKey is a free-form string defined by the consuming project. |