Added View to render payment page, Added Payment and summary forms, Added Payment.js library to request stripe token , Added jQuery validator for handling payment form errors
This commit is contained in:
		
					parent
					
						
							
								4e23adcea6
							
						
					
				
			
			
				commit
				
					
						38801abed7
					
				
			
		
					 13 changed files with 480 additions and 71 deletions
				
			
		
							
								
								
									
										20
									
								
								hosting/mixins.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								hosting/mixins.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| from django.shortcuts import redirect | ||||
| from django.core.urlresolvers import reverse | ||||
| 
 | ||||
| 
 | ||||
| class ProcessVMSelectionMixin(object): | ||||
| 
 | ||||
|     def post(self, request, *args, **kwargs): | ||||
|         vm_specs = { | ||||
|             'cores': request.POST.get('cores'), | ||||
|             'memory': request.POST.get('memory'), | ||||
|             'disk_size': request.POST.get('disk_space'), | ||||
|             'hosting_company': request.POST.get('hosting_company'), | ||||
|             'hosting_company_name': request.POST.get('hosting_company_name'), | ||||
|             'final_price': request.POST.get('final_price') | ||||
|         } | ||||
|         request.session['vm_specs'] = vm_specs | ||||
|         if not request.user.is_authenticated(): | ||||
|             request.session['vm_specs'] = vm_specs | ||||
|             return redirect(reverse('hosting:login')) | ||||
|         return redirect(reverse('hosting:payment')) | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue