diff --git a/datacenterlight/views.py b/datacenterlight/views.py index 7dd2a76f..993cb508 100644 --- a/datacenterlight/views.py +++ b/datacenterlight/views.py @@ -427,7 +427,7 @@ class OrderConfirmationView(DetailView): stripe_utils = StripeUtils() card_details = stripe_utils.get_card_details(customer.stripe_id, request.session.get('token')) if not card_details.get('response_object') and not card_details.get('paid'): - msg = _('Currently its not possible to make payments. Please try later.') + msg = card_details.get('error') messages.add_message(self.request, messages.ERROR, msg, extra_tags='failed_payment') return HttpResponseRedirect(reverse('datacenterlight:payment')) context = { diff --git a/hosting/templates/hosting/payment.html b/hosting/templates/hosting/payment.html index 5ef7f1ce..acb5d389 100644 --- a/hosting/templates/hosting/payment.html +++ b/hosting/templates/hosting/payment.html @@ -49,15 +49,6 @@ -
- {% for message in messages %} - {% if 'failed_payment' in message.tags %} - - {% endif %} - {% endfor %} -
@@ -139,12 +130,23 @@
-

- {% blocktrans %} - You are not making any payment yet. After submitting your card - information, you will be taken to the Confirm Order Page. - {% endblocktrans %} -

+ {% if not messages %} +

+ {% blocktrans %} + You are not making any payment yet. After submitting your card + information, you will be taken to the Confirm Order Page. + {% endblocktrans %} +

+ {% endif %} +
+ {% for message in messages %} + {% if 'failed_payment' in message.tags %} +
  • +

    {{ message|safe }}

    +
+ {% endif %} + {% endfor %} +