170 lines
7 KiB
HTML
170 lines
7 KiB
HTML
{% extends "hosting/base_short.html" %}
|
|
{% load staticfiles bootstrap3 i18n %}
|
|
{% block content %}
|
|
<!-- Credit card form -->
|
|
<div>
|
|
<div class="payment-container">
|
|
<div class="row">
|
|
<div class="col-xs-12 col-md-offset-2 col-md-4 summary-box">
|
|
<form role="form" novalidate>
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<h3><b>{%trans "Billing Amount" %}</b></h3>
|
|
<hr>
|
|
<div class="content">
|
|
<!-- <p><b>Type</b> <span class="pull-right">{{request.session.vm_specs.location_code}}</span></p> -->
|
|
<!-- <hr> -->
|
|
<p><b>{%trans "Cores"%}</b> <span
|
|
class="pull-right">{{request.session.specs.cpu|floatformat}}</span></p>
|
|
<hr>
|
|
<p><b>{%trans "Memory"%}</b> <span
|
|
class="pull-right">{{request.session.specs.memory|floatformat}} GB</span></p>
|
|
<hr>
|
|
<p><b>{%trans "Disk space"%}</b> <span
|
|
class="pull-right">{{request.session.specs.disk_size|floatformat}} GB</span></p>
|
|
<hr>
|
|
<p><b>{%trans "Configuration"%}</b> <span
|
|
class="pull-right">{{request.session.template.name}}</span></p>
|
|
<hr>
|
|
<h4>Total<p
|
|
class="pull-right"><b>{{request.session.specs.price }} CHF</b></p></h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
<div class="col-xs-12 col-md-4 billing">
|
|
<h3><b>{%trans "Billing Address"%}</b></h3>
|
|
<hr>
|
|
<form role="form" id="billing-form" method="post" action="" novalidate>
|
|
{% for field in form %}
|
|
{% csrf_token %}
|
|
{% bootstrap_field field show_label=False type='fields'%}
|
|
{% endfor %}
|
|
{% bootstrap_form_errors form type='non_fields'%}
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-12 col-md-offset-2 col-md-4 "></div>
|
|
<div class="col-xs-12 col-md-4 creditcard-box">
|
|
<h3><b>{%trans "Payment Details"%}</b></h3>
|
|
<hr>
|
|
<div>
|
|
<div>
|
|
{% 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>
|
|
<div class="col-xs-6">
|
|
<button id="payment_button_with_creditcard" class="btn btn-success btn-sm btn-block" type="submit">
|
|
{% trans "Submit Payment" %}
|
|
</button>
|
|
</div>
|
|
{% else %}
|
|
|
|
|
|
<form role="form" id="payment-form" novalidate>
|
|
<div class="row">
|
|
<div class="form-group">
|
|
<div id="card-element">
|
|
<!-- a Stripe Element will be inserted here. -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="card-errors" role="alert"></div>
|
|
|
|
<!-- <div class="row">
|
|
<div class="col-xs-9 col-md-12">
|
|
<div class="form-group">
|
|
<label class="control-label" for="cardNumber">{%trans "CARD NUMBER"%}</label>
|
|
<div class="input-group">
|
|
<input type="text"
|
|
class="form-control"
|
|
name="cardNumber"
|
|
placeholder="{%trans "Valid Card Number"%}" required autofocus data-stripe="number" />
|
|
<span class="input-group-addon"><i class="fa fa-credit-card"></i></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-xs-6 col-md-7">
|
|
<div class="form-group">
|
|
<label for="expMonth">{%trans "EXPIRATION DATE"%}</label><br/>
|
|
<div class="col-xs-6 col-lg-6 col-md-6 pl-ziro">
|
|
<input type="text" class="form-control" name="expMonth" placeholder="MM" required data-stripe="exp_month" />
|
|
</div>
|
|
<div class="col-xs-6 col-lg-6 col-md-6 pl-ziro">
|
|
<input type="text" class="form-control" name="expYear" placeholder="YY" required data-stripe="exp_year" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-xs-4 col-md-5 pull-right">
|
|
<div class="form-group">
|
|
<label for="cvCode">{%trans "CV CODE"%}</label>
|
|
<input type="password" class="form-control" name="cvCode" placeholder="CV" required data-stripe="cvc" />
|
|
</div>
|
|
</div>
|
|
</div> -->
|
|
<div class="row">
|
|
<div class="col-xs-6 float-right">
|
|
<button class="btn btn-success btn-sm btn-block" type="submit">Submit Payment</button>
|
|
</div>
|
|
</div>
|
|
<div class="row" style="display:none;">
|
|
<div class="col-xs-12">
|
|
<p class="payment-errors"></p>
|
|
</div>
|
|
</div>
|
|
{% if paymentError %}
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<p>
|
|
{% bootstrap_alert paymentError alert_type='danger' %}
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
|
|
</form>
|
|
{% endif %}
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- stripe key data -->
|
|
{% if stripe_key %}
|
|
{% get_current_language as LANGUAGE_CODE %}
|
|
<script type="text/javascript">
|
|
|
|
|
|
(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%}
|
|
|
|
|
|
|
|
|