diff --git a/digitalglarus/static/digitalglarus/js/payment.js b/digitalglarus/static/digitalglarus/js/payment.js
index 3179f721..0d95a109 100644
--- a/digitalglarus/static/digitalglarus/js/payment.js
+++ b/digitalglarus/static/digitalglarus/js/payment.js
@@ -27,22 +27,42 @@ $( document ).ready(function() {
//Acept term and conditions button
+ var hasCreditcard = window.hasCreditcard;
+ console.log("has creditcard");
+ console.log("has creditcard");
+ console.log("has creditcard");
+
+ var submit_form_btn = $('#payment_button');
+ submit_form_btn.on('click', submit_payment);
- var submit_form_btn = $('#payment_button');
- submit_form_btn.on('click', submit_payment);
function submit_payment(e){
- $('#billing-form').submit();
+ e.preventDefault();
+ if (hasCreditcard) {
+ $('#billing-form').submit();
+ }
+ else {
+ $('#payment-form').submit();
+
+ }
+
+
+
// $form.submit();
}
+
var $form = $('#payment-form');
$form.submit(payWithStripe);
/* If you're using Stripe for payments */
function payWithStripe(e) {
console.log("submiting");
+ console.log("token");
+ console.log("token");
+ // console.log("token", token);
+
e.preventDefault();
if (!$('.agree-terms').is(':checked')){
diff --git a/digitalglarus/templates/digitalglarus/booking_orders_list.html b/digitalglarus/templates/digitalglarus/booking_orders_list.html
index 9fa3d793..a1cb8e39 100644
--- a/digitalglarus/templates/digitalglarus/booking_orders_list.html
+++ b/digitalglarus/templates/digitalglarus/booking_orders_list.html
@@ -18,7 +18,7 @@
2016.11.13-2016.12.13
Booking history
-
+
# |
diff --git a/digitalglarus/templates/digitalglarus/booking_payment.html b/digitalglarus/templates/digitalglarus/booking_payment.html
index adfb142e..442a2812 100644
--- a/digitalglarus/templates/digitalglarus/booking_payment.html
+++ b/digitalglarus/templates/digitalglarus/booking_payment.html
@@ -212,4 +212,12 @@
{%endif%}
+{% if credit_card_data.last4 and credit_card_data.cc_brand %}
+
+
+{%endif%}
+
+
{% endblock %}
\ No newline at end of file
diff --git a/digitalglarus/templates/digitalglarus/history.html b/digitalglarus/templates/digitalglarus/history.html
index ae407d34..c54a4a72 100755
--- a/digitalglarus/templates/digitalglarus/history.html
+++ b/digitalglarus/templates/digitalglarus/history.html
@@ -4,6 +4,20 @@
{% block content %}
+
+
+