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')
|
msg = subscription_result.get('error')
|
||||||
messages.add_message(self.request, messages.ERROR, msg,
|
messages.add_message(self.request, messages.ERROR, msg,
|
||||||
extra_tags='failed_payment')
|
extra_tags='failed_payment')
|
||||||
return HttpResponseRedirect(
|
response = {
|
||||||
reverse('hosting:payment') + '#payment_error')
|
'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 = {
|
user = {
|
||||||
'name': self.request.user.name,
|
'name': self.request.user.name,
|
||||||
'email': self.request.user.email,
|
'email': self.request.user.email,
|
||||||
|
|
Loading…
Reference in a new issue