import { OnModuleInit } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { Repository } from 'typeorm'; import Stripe from 'stripe'; import { Subscription } from '../entities/subscription.entity'; import { Invoice } from '../entities/invoice.entity'; import { PaymentMethod } from '../entities/payment-method.entity'; import { CreateStripeCustomerDto, CreateStripeSubscriptionDto, CreateCheckoutSessionDto, CreateBillingPortalSessionDto } from '../dto/stripe-webhook.dto'; export declare class StripeService implements OnModuleInit { private readonly configService; private readonly subscriptionRepo; private readonly invoiceRepo; private readonly paymentMethodRepo; private stripe; private readonly logger; constructor(configService: ConfigService, subscriptionRepo: Repository, invoiceRepo: Repository, paymentMethodRepo: Repository); onModuleInit(): void; private ensureStripeConfigured; createCustomer(dto: CreateStripeCustomerDto): Promise; getCustomer(customerId: string): Promise; findCustomerByTenantId(tenantId: string): Promise; updateCustomer(customerId: string, data: Partial<{ email: string; name: string; metadata: Record; }>): Promise; createSubscription(dto: CreateStripeSubscriptionDto): Promise; getStripeSubscription(subscriptionId: string): Promise; cancelStripeSubscription(subscriptionId: string, options?: { immediately?: boolean; }): Promise; updateStripeSubscription(subscriptionId: string, priceId: string): Promise; createCheckoutSession(dto: CreateCheckoutSessionDto): Promise; createBillingPortalSession(dto: CreateBillingPortalSessionDto): Promise; attachPaymentMethod(paymentMethodId: string, customerId: string): Promise; detachPaymentMethod(paymentMethodId: string): Promise; listPaymentMethods(customerId: string): Promise; setDefaultPaymentMethod(customerId: string, paymentMethodId: string): Promise; constructWebhookEvent(payload: Buffer, signature: string): Stripe.Event; handleWebhookEvent(event: Stripe.Event): Promise; private syncSubscription; private handleSubscriptionDeleted; private handleInvoicePaid; private handleInvoicePaymentFailed; private syncPaymentMethod; private handlePaymentMethodDetached; private handleCheckoutCompleted; private mapStripeStatus; listPrices(productId?: string): Promise; getPrice(priceId: string): Promise; createSetupIntent(customerId: string): Promise; }