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 %}
{% if order.invoice %} - + + {% endif %}
+ {% endif %} {% if order_items %} @@ -69,82 +73,85 @@ {% endif %} -
- - - - - - - - - - - - - - - {% for payment in payments %} - - - - - - - - - - - - {% endfor %} - -
- 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 %} - -
- -

{{type.name}}

-
-
- {% endfor %} -
-
-
+ + {% if payments %} +
+ + + + + + + + + + + + + + + {% for payment in payments %} + + + + + + + + + + + + {% endfor %} + +
+ 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 %} + +
+ +

{{type.name}}

+
+
+ {% endfor %} +
+
+
+ {% endif %} diff --git a/osinaweb/customercore/templates/payment_pages/buy-now.html b/osinaweb/customercore/templates/payment_pages/buy-now.html index 86da3b32..ed19f28f 100644 --- a/osinaweb/customercore/templates/payment_pages/buy-now.html +++ b/osinaweb/customercore/templates/payment_pages/buy-now.html @@ -55,10 +55,6 @@ {% endfor %} - {% if item.item_type.name == 'cPanel' %} - - {% endif %} diff --git a/osinaweb/db.sqlite3 b/osinaweb/db.sqlite3 index 43349c81..55f5c694 100644 Binary files a/osinaweb/db.sqlite3 and b/osinaweb/db.sqlite3 differ