Bugfix/handle missing Stripe api key exception (#4013)

* Conditionally initialize Stripe
This commit is contained in:
Thomas Kaul 2024-11-02 22:28:13 +01:00 committed by GitHub
parent de74d5c3d6
commit b2aa31f4ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,6 +28,7 @@ export class SubscriptionService {
private readonly prismaService: PrismaService,
private readonly propertyService: PropertyService
) {
if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) {
this.stripe = new Stripe(
this.configurationService.get('STRIPE_SECRET_KEY'),
{
@ -35,6 +36,7 @@ export class SubscriptionService {
}
);
}
}
public async createCheckoutSession({
couponId,