From e9b636f5121b9195ee3578aaf30316c71659ce70 Mon Sep 17 00:00:00 2001 From: Rakesh Gombi Date: Thu, 25 Mar 2021 21:59:57 +0530 Subject: [PATCH 1/2] Update checkout.html --- shop/templates/shop/checkout.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/shop/templates/shop/checkout.html b/shop/templates/shop/checkout.html index 380ff0b..9754e44 100644 --- a/shop/templates/shop/checkout.html +++ b/shop/templates/shop/checkout.html @@ -100,11 +100,6 @@

Step 2 - Enter Address & Other Details:

document.getElementById('cart').innerHTML = sum; document.getElementById('totalPrice').innerHTML = totalPrice; $('#itemsJson').val(JSON.stringify(cart)); -{% if thank %} -alert('Thanks for ordering with us. Your order is is {{id}}. Use it to track your order using our order tracker'); -localStorage.clear(); -document.location = "/shop"; -{% endif %} $('#amount').val($('#totalPrice').html()) -{% endblock %} \ No newline at end of file +{% endblock %} From 0f5708d451ed59b014a20cdf7118deb2e273a11a Mon Sep 17 00:00:00 2001 From: Rakesh Gombi Date: Thu, 25 Mar 2021 22:01:46 +0530 Subject: [PATCH 2/2] Update views.py --- shop/views.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shop/views.py b/shop/views.py index 88c27e4..8339901 100644 --- a/shop/views.py +++ b/shop/views.py @@ -107,8 +107,6 @@ def checkout(request): order.save() update = OrderUpdate(order_id=order.order_id, update_desc="The order has been placed") update.save() - thank = True - id = order.order_id # return render(request, 'shop/checkout.html', {'thank':thank, 'id': id}) # Request paytm to transfer the amount to your account after payment by user param_dict = { @@ -142,7 +140,8 @@ def handlerequest(request): verify = Checksum.verify_checksum(response_dict, MERCHANT_KEY, checksum) if verify: if response_dict['RESPCODE'] == '01': - print('order successful') + thank= True + return render(request, 'shop/paymentstatus.html', {'response': response_dict, 'thank':thank}) else: print('order was not successful because' + response_dict['RESPMSG']) - return render(request, 'shop/paymentstatus.html', {'response': response_dict}) + return render(request, 'shop/paymentstatus.html', {'response': response_dict})