From 0caa3fd4ecdd948ece46e8611cc116adc32f35aa Mon Sep 17 00:00:00 2001 From: emile Date: Mon, 15 Jul 2024 14:57:35 +0300 Subject: [PATCH] new --- .../__pycache__/views.cpython-310.pyc | Bin 7686 -> 7686 bytes .../payment/__pycache__/views.cpython-310.pyc | Bin 7746 -> 7859 bytes osinaweb/customercore/payment/views.py | 7 + .../inner-customer-order.html | 165 +++++++++--------- .../templates/payment_pages/buy-now.html | 4 - osinaweb/db.sqlite3 | Bin 1568768 -> 1568768 bytes 6 files changed, 93 insertions(+), 83 deletions(-) diff --git a/osinaweb/customercore/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/__pycache__/views.cpython-310.pyc index 0f4f5cd0115d8035ddba8b31fc54139b17208c87..e29ef323e870eef02fd2b576fea3718400569e48 100644 GIT binary patch delta 20 acmZp(X|v(Z=jG*M0D_QjQ#Nw{mIVMcTm{tt delta 20 acmZp(X|v(Z=jG*M0D`nNlQ(kzmIVMb83mjG diff --git a/osinaweb/customercore/payment/__pycache__/views.cpython-310.pyc b/osinaweb/customercore/payment/__pycache__/views.cpython-310.pyc index 5d65c23be69b61147fa3972782809df7d0426653..2a2ffd5230be6ef723b3e40d50698791e63537d8 100644 GIT binary patch delta 1396 zcmb`FO>7%Q6vt=Q>-ERl>vh&2iDM^jJ_>H3DH1}6f>4?SDU>8Yf>Mf*Wjb5oZDYHW z36-PSx{@m)3KoTd@*xXsS`Yya6stgy5P};AB)CR`Bb>Q#q7m~pMir>su(iMW&wKO6 z@BP=`-QRn_s79kN^AlVm9;%?6zz`DD_FBuKKQbg>(ir-wUPl9Jls$jLb)eMY@?)MK8c+kP_W z={?R^ql~>D8RrHWYAYnu_PH@R^#qUb7#W7CNtWxyN!crQ_R1MXx9xqPvc<1&m!szrhuJ_eZR^Z61R$Gdkd>_d-@hVzwAhJi=x<8HF0d@x& z;{#<(#>qrWkx8_Qh@^_xofmN(W8_*GZ6?ShJHV|bzEzEeo|HANb=F$$uV?TXRM@*n z^YW!{u0G3HZT-HfspHfpWp=782CbuMW2thgT(R?ymg;MEg%$9&S}CpBqH5JfRQj+i z+}28K)r|_<4v`YGi?vdjY^$tZ>-}sU!DCajD$h^?mQm@(K-sD|c3Q~^< zJGtLa&q^&WC66R8Lhu#9tAIIx5Pu|(;e>cBHLAgXmYx%*Qy<^`oRlgyv4JC4@ddHA zqxcORR)R93VMTs5tliN33Rbm2AB|r=CGC%-clh}+dEzd8^Ek2PyJiR z3-A`;1;E=9579SQLANCeBeVK(Gt-aH{%wqm{a=;@=uJ<|e|sV>XZPVR zVYICI%tpOk-F*cuel2cf&uiYhxgws=t(ey!dfiI_49}aL+_Y~l Ga_}z~%uYi9 delta 1196 zcmbW0NoW*76o#vM_RdUC&)Uf>*nv|W^#6(SlG(U48801I@H z&D$;c#||bBhM24?dRSMXpol{zAZ%5DT8x-cJ!Z!Bgt(I$fe1uxsYI=y*sc{TAtrQ) z5xq)JO*81MX@?nzk9i>B=&WA7jXE!>VIfG4NuZ6nEJch~%PN=xl{gwyF}W~U=k!|7 zJbDA9Y|%9+KaPO3*c4`A(R;vBA;Z+cI;IvION5eLH<>)GR+}>zajM<6BqpB;*-_e0 zHWH{7-p$g86)|T+4U24}Pz!aogt>kKf^K4NY1;RZ5-Uo{{y5Z|%`7@f|5oB9n?#8f zJrETKJL_J$mozo>4%9Aa?^xJ2e^E=Wt$nDyWw<>*yg1)6e<S(!g-WB;t*m~V4NDa#L_qJHr8US4RIB58*veF1aV1Vjd20xWr3z@;~MJgh#QC^ zqJ+4K=tBHHVtRT;%>1;+#K$ZAT~&7F9hCU{7{dssgFUEv5WR@?h`R#gvQde80&ySl zfGNhJf3Z)Q#_Zd4G-lESV%=fPq3?}d}sEs*YUr|KWF>YNsK;r RQV2!V#P~?{D%Xl&%Xfzn9ZUcK 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 43349c81b97e865a98b5c969e0f917044961e9bb..55f5c6940436bfebf03e53b6f7755d9f0fdf336b 100644 GIT binary patch delta 698 zcmajd&2Q2G6aa8qwv}ycbGk`lJj~C;ENDMz!OQ?f7*Jr)GH{8qQd-J@ZiTimOx$D% zyX=57W>*g$O>`l`#dy_tGJ4S)|A5&)V4_uHvYUtBd&#@JkG$PsZg-gLUI5GaCl~!@ zJYFv?0>j?N#V@y?zAHiZ4P9PUB5|Y0rJHOe!;mr^u8UXWB}OI1YK2izqp8(#KEN08 zRxqUqG{R&Vigt^EjTNEAv9To-MsX)hIuT+4K|Cnw!O)u+?jjI;50Li(88Cq+t7*hE zY8o>^CYxz|0LT+R2G&V%*jbqDFW7(10K-1~Cw08`zIUqo3LLlXAD&E^rcE=0!;>?a z=Z^Jp3jkUymn@b^5c@j@~9{-zZ|=M%^Cxn z1_tXC!s9Jc6E#WNFjQTsQe|GQ88S@e0eByU=1u1ZDCGG3!FtE$J%T zmJ51a5D`6_kb(s~DHL+?&8?Mf=du$kByrbbPC#;FLZ&w3z0IezFI%UW8yNtBN_tgraDZ=QWJ**-P?>v5 zQF*XMu!)OGVYqvUML?QC8jy|(H1*ZC^hgOW2}-R_$`BMI*K*imqmxJfT3N z-H2Tjh{d)Wv5Q|i!EDQsFrEE^c=hJSf_v=K9d3y8Z_mFWK9!w=iFY#t-%Z}ln*}#4 M=iR>ft++1}032s*f&c&j