From 7f4993c3f0fc07a136447ca72d428a21afbc3f69 Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 21 Oct 2017 23:12:53 +0200 Subject: [PATCH] Update hosting payment template to use added cards --- hosting/static/hosting/css/commons.css | 20 ++++++++++ hosting/templates/hosting/payment.html | 52 ++++++++++---------------- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/hosting/static/hosting/css/commons.css b/hosting/static/hosting/css/commons.css index ca320afa..33381370 100644 --- a/hosting/static/hosting/css/commons.css +++ b/hosting/static/hosting/css/commons.css @@ -294,6 +294,26 @@ font-size: 16px; } +.payment-container .credit-card-info { + padding-bottom: 15px; + border-bottom: 1px solid #eee; +} + +.credit-card-info { + display: flex; +} + +.credit-card-info .align-bottom{ + align-self: flex-end; + padding-right: 0 !important; +} + +.another-card-text { + padding: 20px 0; + font-size: 18px; + font-weight: 700; +} + .credit-card-form { max-width: 360px; } diff --git a/hosting/templates/hosting/payment.html b/hosting/templates/hosting/payment.html index a10cfbca..7cadb530 100644 --- a/hosting/templates/hosting/payment.html +++ b/hosting/templates/hosting/payment.html @@ -66,49 +66,37 @@
+ {% with card_list_len=cards_list|length %}

{%trans "Credit Card"%}


+ {% if card_list_len > 0 %} + {% blocktrans %}Please select one of the previous cards that you used or fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} + {% else %} {% blocktrans %}Please fill in your credit card information below. We are using Stripe for payment and do not store your information in our database.{% endblocktrans %} + {% endif %}

- {% if credit_card_data.last4 %} -
-
Credit Card
-
Last 4: *****{{credit_card_data.last4}}
-
Type: {{credit_card_data.cc_brand}}
- -
- {% if not messages and not form.non_field_errors %} -

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

- {% endif %} -
- {% for message in messages %} - {% if 'failed_payment' or 'make_charge_error' in message.tags %} -
    -
  • -

    {{ message|safe }}

    -
  • -
- {% endif %} - {% endfor %} - {% for error in form.non_field_errors %} -

- {{ error|escape }} -

- {% endfor %} + {% for card in cards_list %} +
+
+
{% trans "Credit Card" %}
+
{% trans "Last" %} 4: ***** {{card.last4}}
+
{% trans "Type" %}: {{card.brand}}
+
+
-
- -
- {% else %} - {% include "hosting/includes/_card_input.html" %} + {% endfor %} + {% if card_list_len > 0 %} +
Use another card
{% endif %} + {% include "hosting/includes/_card_input.html" %}
+ {% endwith %}