Skip to content
@archipel/platform-payments Auto-generated

@pixel-brewery/archipel-platform-payments ​

Classes ​

ClassDescription
FeatureAccessPortAbstract 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().
FeatureGuardGuard that checks if the user has access to a specific feature by delegating to the registered FeatureAccessPort.
FeatureUsageInterceptorInterceptor that records feature usage after successful request handling. Delegates recording to the registered FeatureAccessPort.
LemonSqueezyClientLemonSqueezy implementation of the PaymentClientPort. Uses the official @lemonsqueezy/lemonsqueezy.js SDK.
MollieClientMollie implementation of the PaymentClientPort. Uses the official @mollie/api-client to interact with the Mollie API.
PaddleClientPaddle implementation of the PaymentClientPort. Uses the official @paddle/paddle-node-sdk to interact with the Paddle Billing API.
PaymentClientPortAbstract 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.
PaymentErrorDomain error thrown when a payment operation fails.
PaymentHealthIndicatorHealth indicator for the payment infrastructure. Calls PaymentClientPort.ping to verify provider connectivity.
PaymentModuleNestJS 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.
StripeClientStripe implementation of the PaymentClientPort. All Stripe-specific types and logic are encapsulated here.

Interfaces ​

InterfaceDescription
IFeatureAccessContextRequest-scoped context for feature access checks and usage recording.
IFeatureAccessResultResult of a feature access check.
INormalizedCheckoutSessionNormalized checkout session.
INormalizedPriceNormalized price information.
INormalizedSubscriptionNormalized subscription.
INormalizedWebhookEventNormalized webhook event.
IPaymentModuleOptionsConfiguration options for the PaymentModule.

Type Aliases ​

Type AliasDescription
CheckoutPaymentStatusProvider-independent checkout payment status values. unknown represents a provider status without a normalized equivalent.
InvoiceStatusProvider-independent invoice status values. unknown represents a provider status without a normalized equivalent.
SubscriptionStatusProvider-independent subscription status values. unknown represents a provider status without a normalized equivalent.

Variables ​

VariableDescription
FEATURE_KEY_METADATA-
LEMONSQUEEZY_API_KEYLemonSqueezy API key.
LEMONSQUEEZY_CONFIG_ENTRIESConfiguration entries required by the LemonSqueezy payment provider.
LEMONSQUEEZY_STORE_IDLemonSqueezy store ID.
LEMONSQUEEZY_WEBHOOK_SECRETLemonSqueezy webhook signing secret.
MOLLIE_API_KEYMollie API key.
MOLLIE_CONFIG_ENTRIESConfiguration entries required by the Mollie payment provider.
MOLLIE_WEBHOOK_SECRETMollie webhook secret for verifying webhook payloads.
PADDLE_API_KEYPaddle API key.
PADDLE_CONFIG_ENTRIESConfiguration entries required by the Paddle payment provider.
PADDLE_ENVIRONMENTPaddle environment (production or sandbox). Defaults to production.
PADDLE_WEBHOOK_SECRETPaddle webhook secret key.
STRIPE_API_KEYStripe secret API key.
STRIPE_CONFIG_ENTRIESConfiguration entries required by the Stripe payment provider.
STRIPE_WEBHOOK_SECRETStripe webhook signing secret.

Functions ​

FunctionDescription
RequiresFeatureDecorator to mark endpoints that require feature access check. The featureKey is a free-form string defined by the consuming project.

Released under the MIT License.