Respond with JSON
This commit is contained in:
		
					parent
					
						
							
								4334dfaa44
							
						
					
				
			
			
				commit
				
					
						6ef8a03de7
					
				
			
		
					 1 changed files with 13 additions and 2 deletions
				
			
		|  | @ -788,8 +788,19 @@ class OrdersHostingDetailView(LoginRequiredMixin, | |||
|             msg = subscription_result.get('error') | ||||
|             messages.add_message(self.request, messages.ERROR, msg, | ||||
|                                  extra_tags='failed_payment') | ||||
|             return HttpResponseRedirect( | ||||
|                 reverse('hosting:payment') + '#payment_error') | ||||
|             response = { | ||||
|                 'status': False, | ||||
|                 'redirect': "{url}#{section}".format( | ||||
|                     url=reverse('hosting:payment'), | ||||
|                     section='payment_error'), | ||||
|                 'msg_title': str(_('Error.')), | ||||
|                 'msg_body': str( | ||||
|                     _('There was a payment related error.' | ||||
|                       ' On close of this popup, you will be redirected back to' | ||||
|                       ' the payment page.')) | ||||
|             } | ||||
|             return HttpResponse(json.dumps(response), | ||||
|                                 content_type="application/json") | ||||
|         user = { | ||||
|             'name': self.request.user.name, | ||||
|             'email': self.request.user.email, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue