billing form in settings page

This commit is contained in:
Arvind Tiwari 2017-08-29 17:42:35 +05:30
commit ce1d346bc1
5 changed files with 48 additions and 55 deletions

View file

@ -17,6 +17,9 @@
{% csrf_token %}
{% bootstrap_field field show_label=False type='fields'%}
{% endfor %}
<div class="form-group text-right">
<button type="submit" class="btn btn-default btn-custom-delete btn-wide">Save</button>
</div>
</form>
</div>
<div class="col-sm-7 col-md-6 creditcard-box dcl-creditcard">
@ -25,45 +28,14 @@
<div>
<div>
{% if credit_card_data.last4 %}
<form role="form" id="payment-form-with-creditcard" novalidate>
<div class="credit-card-details">
<h5 class="billing-head">{% trans "Credit Card" %}</h5>
<h5 class="membership-lead">{% trans "Last" %} 4: *****{{credit_card_data.last4}}</h5>
<h5 class="membership-lead">{% trans "Type" %}: {{credit_card_data.cc_brand}}</h5>
<input type="hidden" name="credit_card_needed" value="false"/>
</form>
<div class="row">
<div class="col-xs-12">
{% if not messages and not form.non_field_errors %}
<p class="card-warning-content card-warning-addtional-margin">
{% blocktrans %}You are not making any payment here.{% endblocktrans %}
</p>
{% endif %}
<div id='payment_error'>
{% for message in messages %}
{% if 'failed_payment' or 'make_charge_error' in message.tags %}
<ul class="list-unstyled"><li>
<p class="card-warning-content card-warning-error">{{ message|safe }}</p>
</li></ul>
{% endif %}
{% endfor %}
{% for error in form.non_field_errors %}
<p class="card-warning-content card-warning-error">
{{ error|escape }}
</p>
{% endfor %}
</div>
</div>
<div class="col-xs-12">
<div class="col-xs-6 pull-right">
<button id="payment_button_with_creditcard" class="btn btn-success stripe-payment-btn"
type="submit">
{%trans "Submit" %}
</button>
</div>
</div>
</div>
{% else %}
<h4>{% trans "Add new Card" %}</h4>
<h4>{% trans "No Cards found for your account." %}</h4>
{% comment %}
<form action="" id="payment-form-new" class="credit-card-form" method="POST">
<input type="hidden" name="token"/>
<div class="credit-card-goup">
@ -120,6 +92,7 @@
<p class="payment-errors"></p>
</div>
</form>
{% endcomment %}
{% endif %}
</div>
</div>