diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index 0f4f5cd0..e29ef323 100644 Binary files a/osinaweb/customercore/__pycache__/views.cpython-310.pyc and b/osinaweb/customercore/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/customercore/payment/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/payment/__pycache__/views.cpython-310.pyc index 5d65c23b..2a2ffd52 100644 Binary files a/osinaweb/customercore/payment/__pycache__/views.cpython-310.pyc and b/osinaweb/customercore/payment/__pycache__/views.cpython-310.pyc differ diff --git a/osinaweb/customercore/payment/views.py b/osinaweb/customercore/payment/views.py index 9aa55372..e64c5842 100644 --- a/osinaweb/customercore/payment/views.py +++ b/osinaweb/customercore/payment/views.py @@ -199,6 +199,7 @@ def check_order_status(request, merchant_id, order_id): api_password = '549c33e1bc4aea6fcf96f9943e6c0256' url = f"https://creditlibanais-netcommerce.gateway.mastercard.com/api/rest/version/78/merchant/{merchant_id}/order/{order_id}" order = Order.objects.get(order_id=order_id) + payment = get_object_or_404(PaymentType, name='Online Payment') headers = { 'Content-Type': 'application/json', @@ -216,6 +217,12 @@ def check_order_status(request, merchant_id, order_id): status = 'Completed', date = datetime.now() ) + OrderPayment.objects.create( + order = order, + amount = order.get_cart_total, + date_paid = datetime.now(), + type = payment, + ) order_items = OrderItem.objects.filter(order=order) for order_item in order_items: order_item.purchased_at = datetime.now() diff --git a/osinaweb/customercore/templates/details_templates/inner-customer-order.html b/osinaweb/customercore/templates/details_templates/inner-customer-order.html index 7cf6a923..bed31cfc 100644 --- a/osinaweb/customercore/templates/details_templates/inner-customer-order.html +++ b/osinaweb/customercore/templates/details_templates/inner-customer-order.html @@ -26,10 +26,11 @@
Remaining Balance: ${{order.remaining_balance}}
+ {% if order.invoice %} + {% endif %} {% if order_items %} @@ -69,82 +73,85 @@ {% endif %} -- Amount - | -- Date Due - | -- Date Paid - | -- Comment - | -- Payment - | -
---|---|---|---|---|
- ${{payment.amount}} - |
-
-
- {% if payment.date_due %}
- {{payment.date_due}} - {% else %} -- - {% endif %} - |
-
-
- {% if payment.date_paid %}
- {{payment.date_paid}} - {% else %} -UNPAID - {% endif %} - |
-
-
- Comment - |
-
-
-
- {% for type in payment.type.all %}
-
-
-
-
-
- {% endfor %}
- {{type.name}} - |
-
+ Amount + | ++ Date Due + | ++ Date Paid + | ++ Comment + | ++ Payment + | +
---|---|---|---|---|
+ ${{payment.amount}} + |
+
+
+ {% if payment.date_due %}
+ {{payment.date_due}} + {% else %} +- + {% endif %} + |
+
+
+ {% if payment.date_paid %}
+ {{payment.date_paid}} + {% else %} +UNPAID + {% endif %} + |
+
+
+ Comment + |
+
+
+
+ {% for type in payment.type.all %}
+
+
+
+
+
+ {% endfor %}
+ {{type.name}} + |
+