Browse Source
			
			
			Bugfix/handle missing Stripe api key exception (#4013)
			
				* Conditionally initialize Stripe
			
			
				pull/4014/head
			
			
		 
		
			
				
					
						
						Thomas Kaul
					
					1 year ago
					
						
							committed by
							
								
								GitHub
							
						 
					
				 
				
			 
		 
		
			
				
					
					No known key found for this signature in database
					
						
							GPG Key ID: B5690EEEBB952194
						
					
				
			
		
		
		
	
		
			
				 1 changed files with 
8 additions and 
6 deletions
			 
			
		 
		
			
				- 
					
					
					 
					apps/api/src/app/subscription/subscription.service.ts
				
 
			
		
		
			
			
			
			
			
			
				
				
					
						
							
								
									
	
		
			
				
					| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -28,12 +28,14 @@ export class SubscriptionService { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private readonly prismaService: PrismaService, | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private readonly propertyService: PropertyService | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  ) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    this.stripe = new Stripe( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      this.configurationService.get('STRIPE_SECRET_KEY'), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        apiVersion: '2024-09-30.acacia' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    ); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    if (this.configurationService.get('ENABLE_FEATURE_SUBSCRIPTION')) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      this.stripe = new Stripe( | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        this.configurationService.get('STRIPE_SECRET_KEY'), | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					          apiVersion: '2024-09-30.acacia' | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					      ); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					  public async createCheckoutSession({ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |