dynamicweb/datacenterlight/templates/datacenterlight/landing_payment.html

157 lines
8 KiB
HTML
Raw Normal View History

{% extends "hosting/base_short.html" %}
{% load staticfiles bootstrap3 i18n %}
2017-09-04 18:54:18 +00:00
{% block css_extra %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/paymentfont/1.1.2/css/paymentfont.min.css"/>
{% endblock css_extra %}
{% block navbar %}
{% include "datacenterlight/includes/_navbar.html" %}
{% endblock navbar %}
{% block content %}
<!-- Credit card form -->
<div class="dcl-order-container">
<div class="payment-container">
2017-09-06 21:17:57 +00:00
<div class="dcl-payment-grid">
<div class="dcl-payment-box">
2017-09-05 18:42:13 +00:00
<div class="dcl-payment-section">
2017-09-07 14:26:34 +00:00
{% if request.user.is_authenticated %}
<div class="dcl-payment-user">
<h4>{% trans "Welcome back" %} {{request.user.name}}!</h4>
<p>{% trans "Review your billing address and card details and proceed to make payment." %}</p>
2017-09-05 18:42:13 +00:00
</div>
2017-09-07 14:26:34 +00:00
{% else %}
<h3>{%trans "Log in" %}</h3>
<hr class="top-hr">
<p style="margin-bottom: 20px;">{% blocktrans %}Already signed up?<br>By logging in you can retrieve saved billing information.{% endblocktrans %}</p>
<form role="form" id="login-form" method="post" action="" novalidate>
2017-09-07 14:26:34 +00:00
{% for field in login_form %}
{% csrf_token %}
{% bootstrap_field field show_label=False type='fields'%}
{% endfor %}
<p class="text-danger">{{login_form.non_field_errors|striptags}}</p>
2017-09-07 14:26:34 +00:00
<input type='hidden' name='next' value='{{request.path}}'/>
<div class="form-group text-right">
<button type="submit" class="btn btn-wide btn-vm-contact" name="login_form">{% trans "LOGIN" %}</button>
2017-09-07 14:26:34 +00:00
</div>
</form>
<p>
{% trans "Don't have an account yet?" %}<br>
{% trans "You can sign up by filling in the information below." %}<br>
<a href="{% url 'hosting:reset_password' %}">{% trans "Forgot password?" %}</a>
</p>
{% endif %}
2017-09-05 18:42:13 +00:00
</div>
2017-09-04 18:54:18 +00:00
</div>
2017-09-06 21:17:57 +00:00
<div class="dcl-payment-box">
2017-09-05 18:42:13 +00:00
<div class="dcl-payment-section">
2017-09-07 14:26:34 +00:00
{% if not request.user.is_authenticated %}
<h3><b>{%trans "Sign up"%}</b></h3>
{% else %}
<h3><b>{%trans "Billing Address"%}</b></h3>
{% endif %}
2017-09-06 21:17:57 +00:00
<hr class="top-hr">
{% for message in messages %}
{% if 'duplicate_email' in message.tags %}
<p class="text-danger">{{message}}</p>
{% endif %}
{% endfor %}
<form role="form" id="billing-form" method="post" action="" novalidate>
{% csrf_token %}
{% for field in billing_address_form %}
{% bootstrap_field field show_label=False type='fields'%}
{% endfor %}
</form>
</div>
2017-09-05 18:42:13 +00:00
</div>
2017-09-12 20:25:58 +00:00
<div class="dcl-payment-box">
<div class="dcl-payment-section">
<h3>{%trans "Your Order" %}</h3>
<hr class="top-hr">
<div class="dcl-payment-order">
<p>{% trans "Cores"%} <strong class="pull-right">{{request.session.specs.cpu|floatformat}}</strong></p>
<hr>
<p>{% trans "Memory"%} <strong class="pull-right">{{request.session.specs.memory|floatformat}} GB</strong></p>
<hr>
<p>{% trans "Disk space"%} <strong class="pull-right">{{request.session.specs.disk_size|floatformat}} GB</strong></p>
<hr>
<p>{% trans "Configuration"%} <strong class="pull-right">{{request.session.template.name}}</strong></p>
<hr>
<p class="last-p"><strong>{%trans "Total" %}</strong>&nbsp;&nbsp;<small>({%trans "including VAT" %})</small> <strong class="pull-right">{{request.session.specs.price}} CHF/{% trans "Month" %}</strong></p>
</div>
</div>
</div>
2017-09-06 21:17:57 +00:00
<div class="dcl-payment-box">
2017-09-05 18:42:13 +00:00
<div class="dcl-payment-section">
<h3><b>{%trans "Credit Card"%}</b></h3>
2017-09-06 21:17:57 +00:00
<hr class="top-hr">
2017-09-07 14:26:34 +00:00
<p>
2017-09-08 18:16:29 +00:00
{% blocktrans %}Please fill in your credit card information below. We are using <a href="https://stripe.com" target="_blank">Stripe</a> for payment and do not store your information in our database.{% endblocktrans %}
2017-09-07 14:26:34 +00:00
</p>
<div>
2017-09-07 14:26:34 +00:00
{% if credit_card_data.last4 %}
<form role="form" id="payment-form-with-creditcard" novalidate>
<h5 class="billing-head">Credit Card</h5>
<h5 class="membership-lead">Last 4: *****{{credit_card_data.last4}}</h5>
<h5 class="membership-lead">Type: {{credit_card_data.cc_brand}}</h5>
<input type="hidden" name="credit_card_needed" value="false"/>
</form>
{% if not messages and not form.non_field_errors %}
<p class="card-warning-content card-warning-addtional-margin">
{% trans "You are not making any payment yet. After submitting your card information, you will be taken to the Confirm Order Page." %}
</p>
{% endif %}
<div id='payment_error'>
{% for message in messages %}
{% if 'failed_payment' or 'make_charge_error' in message.tags %}
2017-10-03 12:48:18 +00:00
<ul class="list-unstyled">
<li>
<p class="card-warning-content card-warning-error">{{ message|safe }}</p>
</li>
</ul>
2017-09-07 14:26:34 +00:00
{% endif %}
{% endfor %}
{% for error in form.non_field_errors %}
<p class="card-warning-content card-warning-error">
{{ error|escape }}
</p>
{% endfor %}
</div>
<div class="text-right">
2017-10-03 12:48:18 +00:00
<button id="payment_button_with_creditcard" class="btn btn-vm-contact" type="submit">{%trans "SUBMIT" %}</button>
2017-09-07 14:26:34 +00:00
</div>
{% else %}
2017-10-05 19:47:35 +00:00
{% include "hosting/includes/_card_input.html" %}
2017-09-07 14:26:34 +00:00
{% endif %}
</div>
</div>
</div>
</div>
</div>
</div>
<!-- stripe key data -->
{% if stripe_key %}
{% get_current_language as LANGUAGE_CODE %}
<script type="text/javascript">
window.processing_text = '{%trans "Processing" %}';
window.enter_your_card_text = '{%trans "Enter your credit card number" %}';
(function () {
window.stripeKey = "{{stripe_key}}";
window.current_lan = "{{LANGUAGE_CODE}}";
})();
</script>
{%endif%}
{% if credit_card_data.last4 and credit_card_data.cc_brand %}
<script type="text/javascript">
(function () {
window.hasCreditcard = true;
})();
</script>
{%endif%}
{%endblock%}