| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -18,6 +18,7 @@ PORT = 8100 if 'port' not in PARAMS else int(PARAMS['port']) ;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					path = PARAMS['path'] #os.environ['CONFIG']
 | 
					 | 
					 | 
					 | 
					path = PARAMS['path'] #os.environ['CONFIG']
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					f = open(path)
 | 
					 | 
					 | 
					 | 
					f = open(path)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					CONFIG = json.loads(f.read())
 | 
					 | 
					 | 
					 | 
					CONFIG = json.loads(f.read())
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					CONTEXT= ('/'+PARAMS['context']) if 'context' in PARAMS else ''
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					stripe_keys = {
 | 
					 | 
					 | 
					 | 
					stripe_keys = {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    'secret_key': CONFIG['stripe']['secret'].strip(),
 | 
					 | 
					 | 
					 | 
					    'secret_key': CONFIG['stripe']['secret'].strip(),
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    'publishable_key': CONFIG['stripe']['pub'].strip()
 | 
					 | 
					 | 
					 | 
					    'publishable_key': CONFIG['stripe']['pub'].strip()
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -165,7 +166,7 @@ def get_plans(app_name) :
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						#
 | 
					 | 
					 | 
					 | 
						#
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						# @TODO: Mark the plans the current user is signed up for
 | 
					 | 
					 | 
					 | 
						# @TODO: Mark the plans the current user is signed up for
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						#
 | 
					 | 
					 | 
					 | 
						#
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return render_template('subscribe.html',uid=uid,app_name=app_name,plans=plans,apikey=apikey)
 | 
					 | 
					 | 
					 | 
						return render_template('subscribe.html',context=CONTEXT,uid=uid,app_name=app_name,plans=plans,apikey=apikey)
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						
 | 
					 | 
					 | 
					 | 
						
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					@app.route('/subscribe/<name>',methods=['DELETE'])
 | 
					 | 
					 | 
					 | 
					@app.route('/subscribe/<name>',methods=['DELETE'])
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					def cancel_subscribe(name) :
 | 
					 | 
					 | 
					 | 
					def cancel_subscribe(name) :
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -199,7 +200,7 @@ def is_customer (app_name):
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						apikey = CONFIG['stripe']['pub'].strip()
 | 
					 | 
					 | 
					 | 
						apikey = CONFIG['stripe']['pub'].strip()
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						
 | 
					 | 
					 | 
					 | 
						
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						amount = amount / 100
 | 
					 | 
					 | 
					 | 
						amount = amount / 100
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						return render_template('bill.html',apikey=apikey,app_name=app_name.replace('-',' '),plans=plans,total_amount=amount)
 | 
					 | 
					 | 
					 | 
						return render_template('bill.html',context=CONTEXT,apikey=apikey,app_name=app_name.replace('-',' '),plans=plans,total_amount=amount)
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					if __name__ == '__main__' :
 | 
					 | 
					 | 
					 | 
					if __name__ == '__main__' :
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
						app.debug = True ;
 | 
					 | 
					 | 
					 | 
						app.debug = True ;
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |