From 1c3d3efb3a7a328cf0fed7cb3ff2844a27d187fe Mon Sep 17 00:00:00 2001 From: Amal Elshihaby Date: Thu, 12 Aug 2021 12:28:19 +0200 Subject: [PATCH] List all the credit cards and the ability to add more cards --- .../matrixhosting/images/mastercard.png | Bin 0 -> 5170 bytes .../static/matrixhosting/images/visa.png | Bin 0 -> 4423 bytes .../static/matrixhosting/js/payment.js | 97 ++------ .../static/matrixhosting/js/stripe.js | 79 +++++++ .../templates/matrixhosting/base.html | 1 + .../templates/matrixhosting/cards.html | 210 ++++++++++++++++++ .../matrixhosting/includes/_card.html | 9 - .../matrixhosting/includes/_navbar.html | 4 +- .../templates/matrixhosting/instances.html | 53 +++++ .../matrixhosting/order_confirmation.html | 8 +- .../matrixhosting/order_details.html | 20 +- .../templates/matrixhosting/payments.html | 10 +- matrixhosting/urls.py | 4 +- matrixhosting/views.py | 114 +++++++--- uncloud/.env | 3 +- uncloud/settings.py | 4 +- uncloud/urls.py | 2 +- uncloud_pay/models.py | 13 +- uncloud_pay/serializers.py | 15 +- uncloud_pay/stripe.py | 12 +- uncloud_pay/urls.py | 9 + uncloud_pay/views.py | 21 +- 22 files changed, 529 insertions(+), 159 deletions(-) create mode 100644 matrixhosting/static/matrixhosting/images/mastercard.png create mode 100644 matrixhosting/static/matrixhosting/images/visa.png create mode 100644 matrixhosting/static/matrixhosting/js/stripe.js create mode 100644 matrixhosting/templates/matrixhosting/cards.html create mode 100644 matrixhosting/templates/matrixhosting/instances.html create mode 100644 uncloud_pay/urls.py diff --git a/matrixhosting/static/matrixhosting/images/mastercard.png b/matrixhosting/static/matrixhosting/images/mastercard.png new file mode 100644 index 0000000000000000000000000000000000000000..a013447288007cf3923c29ddd0b0deeb51ef9cb4 GIT binary patch literal 5170 zcmV-26wT|2P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT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|To4eC|ZTCjL_xlmbbxkVn z^28&XXi6-F*p*y~UmO}^dSa1_(?!r`d4PF058O>N7bs0jqtC9*?f9O96oOqt?KH++ zthH!u@LkErwsg|n9Ou5SMm#BbXiEnj&2a){(8iLCy7ad-u3oS=pm?ouhE&XDzE~#~aWJb~K#YuxjP~{QZM+i_QbMJ!sRkNjp()|5 z^dr_i5dw0HH5MxY${1RbQ93e7tTN0MYg7XTLJ;$uB?7y_hDxBR z1PafQBz+fGikr3$LI|?i>_zu(yFP6o>AR$2OU;_nhGm8qLeP|mAmtLwN?U57#u3om z;FD>LA^~L#m2w>m#C?ax_|jSC`ad^HD(aF>cxbbvv;T{UEYueC-RrakZS*Zj66&|m zEuR= 0; i--) { - brandIconElement.classList.remove(brandIconElement.classList[i]); - } - brandIconElement.classList.add('fab'); - brandIconElement.classList.add(pfClass); -} - function fetch_pricing() { var url = '/pricing/' + $('input[name="pricing_name"]').val() + '/calculate/'; var cores = $('#cores').val(); @@ -20,8 +10,18 @@ function fetch_pricing() { dataType: 'json', success: function (data) { if (data && data['total']) { - $('#total').text(data['total'] + " CHF"); $('#recurring_price').text(data['recurring_price'] + " CHF"); + $('#vat').text(data['vat_amount'] + " CHF"); + $('#total').text(data['total'] + " CHF"); + var balance = parseFloat($('#balance').data('balance')); + if(data['total'] > balance) { + $('#has-enough-balance').hide(); + $('#cards-section').show(); + window.cardNumberElement = loadStripe(stripe); + } else { + $('#cards-section').hide(); + $('#has-enough-balance').show(); + } } } }); @@ -43,8 +43,9 @@ function incrementValue(e) { return false; }; - $(document).ready(function () { + var stripe = Stripe(window.stripeKey); + if ($('#pricing_name') != undefined) { fetch_pricing(); } @@ -54,72 +55,8 @@ $(document).ready(function () { $('.fa-minus-circle.left').bind('click', {inc: -1}, incrementValue); var hasCreditcard = window.hasCreditcard || false; - if (hasCreditcard && window.stripeKey) { - var stripe = Stripe(window.stripeKey); - if (window.pm_id == undefined) { - var element_style = { - fonts: [{ - family: 'lato-light', - src: 'url(https://cdn.jsdelivr.net/font-lato/2.0/Lato/Lato-Light.woff) format("woff2")' - }, { - family: 'lato-regular', - src: 'url(https://cdn.jsdelivr.net/font-lato/2.0/Lato/Lato-Regular.woff) format("woff2")' - } - ], - locale: window.current_lan - }; - var elements = stripe.elements(element_style); - var credit_card_text_style = { - base: { - iconColor: '#666EE8', - color: '#31325F', - lineHeight: '25px', - fontWeight: 300, - fontFamily: "'lato-light', sans-serif", - fontSize: '14px', - '::placeholder': { - color: '#777' - } - }, - invalid: { - iconColor: '#eb4d5c', - color: '#eb4d5c', - lineHeight: '25px', - fontWeight: 300, - fontFamily: "'lato-regular', sans-serif", - fontSize: '14px', - '::placeholder': { - color: '#eb4d5c', - fontWeight: 400 - } - } - }; - - var enter_ccard_text = "Enter your credit card number"; - if (typeof window.enter_your_card_text !== 'undefined') { - enter_ccard_text = window.enter_your_card_text; - } - var cardNumberElement = elements.create('cardNumber', { - style: credit_card_text_style, - placeholder: enter_ccard_text - }); - cardNumberElement.mount('#card-number-element'); - - var cardExpiryElement = elements.create('cardExpiry', { - style: credit_card_text_style - }); - cardExpiryElement.mount('#card-expiry-element'); - - var cardCvcElement = elements.create('cardCvc', { - style: credit_card_text_style - }); - cardCvcElement.mount('#card-cvc-element'); - cardNumberElement.on('change', function (event) { - if (event.brand) { - setBrandIcon(event.brand); - } - }); - } + if (hasCreditcard) { + window.cardNumberElement = loadStripe(stripe); } function submitBillingForm(pmId) { @@ -141,7 +78,7 @@ $(document).ready(function () { } stripe.createPaymentMethod({ type: 'card', - card: cardNumberElement, + card: window.cardNumberElement, }) .then(function(result) { // Handle result.error or result.paymentMethod @@ -154,7 +91,7 @@ $(document).ready(function () { stripePMHandler(result.paymentMethod); } }); - window.card = cardNumberElement; + window.card = window.cardNumberElement; } /* Form validation */ diff --git a/matrixhosting/static/matrixhosting/js/stripe.js b/matrixhosting/static/matrixhosting/js/stripe.js new file mode 100644 index 0000000..04a03b1 --- /dev/null +++ b/matrixhosting/static/matrixhosting/js/stripe.js @@ -0,0 +1,79 @@ +function setBrandIcon(brand) { + var brandIconElement = document.getElementById('brand-icon'); + var pfClass = 'fa-cc-' + brand; + for (var i = brandIconElement.classList.length - 1; i >= 0; i--) { + brandIconElement.classList.remove(brandIconElement.classList[i]); + } + brandIconElement.classList.add('fab'); + brandIconElement.classList.add(pfClass); +}; + +function loadStripe(stripe) { + var cardNumberElement; + if (stripe) { + var element_style = { + fonts: [{ + family: 'lato-light', + src: 'url(https://cdn.jsdelivr.net/font-lato/2.0/Lato/Lato-Light.woff) format("woff2")' + }, { + family: 'lato-regular', + src: 'url(https://cdn.jsdelivr.net/font-lato/2.0/Lato/Lato-Regular.woff) format("woff2")' + } + ], + locale: window.current_lan + }; + var elements = stripe.elements(element_style); + var credit_card_text_style = { + base: { + iconColor: '#666EE8', + color: '#31325F', + lineHeight: '25px', + fontWeight: 300, + fontFamily: "'lato-light', sans-serif", + fontSize: '14px', + '::placeholder': { + color: '#777' + } + }, + invalid: { + iconColor: '#eb4d5c', + color: '#eb4d5c', + lineHeight: '25px', + fontWeight: 300, + fontFamily: "'lato-regular', sans-serif", + fontSize: '14px', + '::placeholder': { + color: '#eb4d5c', + fontWeight: 400 + } + } + }; + + var enter_ccard_text = "Enter your credit card number"; + if (typeof window.enter_your_card_text !== 'undefined') { + enter_ccard_text = window.enter_your_card_text; + } + cardNumberElement = elements.create('cardNumber', { + style: credit_card_text_style, + placeholder: enter_ccard_text + }); + cardNumberElement.mount('#card-number-element'); + + var cardExpiryElement = elements.create('cardExpiry', { + style: credit_card_text_style + }); + cardExpiryElement.mount('#card-expiry-element'); + + var cardCvcElement = elements.create('cardCvc', { + style: credit_card_text_style + }); + cardCvcElement.mount('#card-cvc-element'); + cardNumberElement.on('change', function (event) { + if (event.brand) { + setBrandIcon(event.brand); + } + }); + } + return cardNumberElement; +}; + diff --git a/matrixhosting/templates/matrixhosting/base.html b/matrixhosting/templates/matrixhosting/base.html index dcda82d..011e71e 100644 --- a/matrixhosting/templates/matrixhosting/base.html +++ b/matrixhosting/templates/matrixhosting/base.html @@ -55,6 +55,7 @@ crossorigin="anonymous" > + {% block js_extra %} {% endblock js_extra %} {% compress js %} diff --git a/matrixhosting/templates/matrixhosting/cards.html b/matrixhosting/templates/matrixhosting/cards.html new file mode 100644 index 0000000..569b9b9 --- /dev/null +++ b/matrixhosting/templates/matrixhosting/cards.html @@ -0,0 +1,210 @@ +{% extends "matrixhosting/base.html" %} + +{% load static i18n compress %} + +{% block title %} Payments {% endblock %} + +{% block content %} +
+
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+

{% trans "Credit or Debit Cards"%} ({% trans "for payments"%})

+
+
+ {% for card in object_list %} +
+ +
+ {% endfor %} + +
+
+
+
+ + +
+
+
+
+
+{% endblock %} +{% block js_extra %} + + + +{% endblock js_extra %} \ No newline at end of file diff --git a/matrixhosting/templates/matrixhosting/includes/_card.html b/matrixhosting/templates/matrixhosting/includes/_card.html index d0dbd79..9cb9462 100644 --- a/matrixhosting/templates/matrixhosting/includes/_card.html +++ b/matrixhosting/templates/matrixhosting/includes/_card.html @@ -24,15 +24,6 @@
-
- {% for message in messages %} - {% if 'failed_payment' in message.tags or 'make_charge_error' in message.tags or 'error' in message.tags %} -
    -
  • {{ message|safe }}

  • -
- {% endif %} - {% endfor %} -
diff --git a/matrixhosting/templates/matrixhosting/includes/_navbar.html b/matrixhosting/templates/matrixhosting/includes/_navbar.html index d6da1e9..83f4153 100644 --- a/matrixhosting/templates/matrixhosting/includes/_navbar.html +++ b/matrixhosting/templates/matrixhosting/includes/_navbar.html @@ -61,7 +61,7 @@
  • See all Notifications
  • -