new card details option added

This commit is contained in:
Arvind Tiwari 2017-10-06 01:59:18 +05:30
parent bd3c59eb3e
commit ba8eaa2937
3 changed files with 49 additions and 17 deletions

View file

@ -315,8 +315,15 @@
text-decoration: none; text-decoration: none;
} }
.settings-container .credit-card-details-opt { .settings-container .new-card-head {
padding-top: 15px; margin-top: 40px;
margin-bottom: 30px;
}
.settings-container .new-card-head h4 {
font-size: 15px;
margin-top: 8px;
font-weight: 600;
} }
.caps-link .svg-img { .caps-link .svg-img {
@ -335,7 +342,11 @@
.settings-container .btn-vm-contact { .settings-container .btn-vm-contact {
font-weight: 600; font-weight: 600;
font-size: 13px; font-size: 13px;
/* padding: 4px 15px; */ }
.settings-container .choice-btn {
letter-spacing: 1px;
min-width: 127px;
} }
.btn-wide { .btn-wide {
@ -376,3 +387,12 @@
color: #999; color: #999;
fill: #999; fill: #999;
} }
.card-details-box {
border: 1px solid #eee;
padding: 5px 25px 25px;
}
.thick-hr {
border-top: 5px solid #eee;
}

View file

@ -35,32 +35,44 @@
<h5 class="billing-head">{% trans "Credit Card" %}</h5> <h5 class="billing-head">{% trans "Credit Card" %}</h5>
<h5 class="membership-lead">{% trans "Last" %} 4: ***** {{card.last4}}</h5> <h5 class="membership-lead">{% trans "Last" %} 4: ***** {{card.last4}}</h5>
<h5 class="membership-lead">{% trans "Type" %}: {{card.cc_brand}}</h5> <h5 class="membership-lead">{% trans "Type" %}: {{card.cc_brand}}</h5>
{% comment %}
{% endcomment %}
<div class="credit-card-details-opt"> <div class="credit-card-details-opt">
<div class="row"> <div class="row">
<div class="col-xs-6"> <div class="col-xs-6">
<a class="caps-link" href=""><img src="{% static 'hosting/img/delete.svg' %}" class="svg-img">{% trans "REMOVE CARD" %}</a> <a class="caps-link" href=""><img src="{% static 'hosting/img/delete.svg' %}" class="svg-img">{% trans "REMOVE CARD" %}</a>
</div> </div>
<div class="col-xs-6 text-right"> <div class="col-xs-6 text-right">
<a class="btn btn-vm-contact" href="">{% trans "EDIT CARD" %}</a> <a class="btn choice-btn choice-btn-faded" href="">{% trans "SELECT" %}</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{% endfor %} {% empty %}
{% if credit_card_data.last4 %}
{% else %}
<div class="no-cards"> <div class="no-cards">
<h4>{% trans "No Credit Cards Added" %}</h4> <h4>{% trans "No Credit Cards Added" %}</h4>
<p>{% blocktrans %}We are using <a href="https://stripe.com">Stripe</a> for payment and do not store your information in our database.{% endblocktrans %}</p> <p>{% blocktrans %}We are using <a href="https://stripe.com">Stripe</a> for payment and do not store your information in our database.{% endblocktrans %}</p>
</div> </div>
{% endfor %}
<h4>{% trans "Add a new Card." %}</h4> <div class="new-card-head">
<div class="row">
<div class="col-xs-6">
<h4>{% trans "Add a new credit card" %}</h4>
</div>
<div class="col-xs-6 text-right">
<button data-toggle="collapse" data-target="#newcard" class="btn choice-btn">
<span class="fa fa-plus"></span>&nbsp;&nbsp;{% trans "NEW CARD" %}
</button>
</div>
</div>
</div>
<div id="newcard" class="collapse">
<hr class="thick-hr">
<div class="card-details-box">
<h3>{%trans "New Credit Card" %}</h3>
<hr>
{% include "hosting/includes/_card_input.html" %} {% include "hosting/includes/_card_input.html" %}
{% comment %} </div>
{% endcomment %} </div>
{% endif %}
</div> </div>
</div> </div>
</div> </div>

View file

@ -540,7 +540,7 @@ class SettingsView(LoginRequiredMixin, FormView):
cards_list = [] cards_list = []
for order in hosting_orders: for order in hosting_orders:
credit_card_data = order.get_cc_data() credit_card_data = order.get_cc_data()
if credit_card_data: if credit_card_data and (credit_card_data not in cards_list):
cards_list.append(credit_card_data) cards_list.append(credit_card_data)
context.update({ context.update({
'cards_list': cards_list, 'cards_list': cards_list,