UNPKG

@gsb-core/core

Version:

GSB core services and classes for platform-independent web applications

38 lines (37 loc) 1.34 kB
import { GsbSubscription, GsbSubscriptionPlan, PaymentType, SubscriptionPlanStatus } from '../../models/gsb-subscription.model'; /** * Subscription service that handles all Paddle integration and subscription management */ export declare class SubscriptionService { private static instance; private paddleApiKey; private paddleWebhookSecret; private paddleClientToken; private paddleEnvironment; private constructor(); static getInstance(): SubscriptionService; /** * Create a new subscription plan */ createSubscriptionPlan(userId: string, tenantId: string, title: string, paymentType?: PaymentType, status?: SubscriptionPlanStatus): Promise<GsbSubscriptionPlan>; /** * Create a new subscription */ createSubscription(userId: string, planId: string, productVariantId: string, quantity?: number): Promise<GsbSubscription>; /** * Process a Paddle webhook event */ processWebhookEvent(event: any): Promise<boolean>; private handleSubscriptionCreated; private handleSubscriptionUpdated; private handleSubscriptionCancelled; private handlePaymentSucceeded; private handlePaymentFailed; /** * Get Paddle client configuration */ getPaddleConfig(): { environment: "production" | "sandbox"; token: string; }; }