Browse Source

支付 返回页面

chenshibin 4 years ago
parent
commit
d99086e16c
1 changed files with 12 additions and 13 deletions
  1. 12 13
      Controller/CloudStorage.py

+ 12 - 13
Controller/CloudStorage.py

@@ -886,14 +886,13 @@ class CloudStorageView(View):
                     dvq.update(**dvq_set_update_dict)
                     dvq.update(**dvq_set_update_dict)
 
 
                 order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
                 order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
-                red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
-
+                red_url = "{SERVER_DOMAIN}web/paid2/success.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
                 return HttpResponseRedirect(red_url)
                 return HttpResponseRedirect(red_url)
             return response.json(0, signature)
             return response.json(0, signature)
         except Exception as e:
         except Exception as e:
             if order_qs:
             if order_qs:
                 order_qs.update(status=10)
                 order_qs.update(status=10)
-            red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
+            red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
             return HttpResponseRedirect(red_url)
             return HttpResponseRedirect(red_url)
 
 
     def do_pay_by_paypal_callback(self, request_dict, response):
     def do_pay_by_paypal_callback(self, request_dict, response):
@@ -905,8 +904,8 @@ class CloudStorageView(View):
             order_qs = Order_Model.objects.filter(orderID=orderID, status=0)
             order_qs = Order_Model.objects.filter(orderID=orderID, status=0)
 
 
             if not orderID:
             if not orderID:
-                red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
-                return response.json(0, red_url)
+                red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
+                return HttpResponseRedirect(red_url)
             else:
             else:
                 order_qs.update(status=10)
                 order_qs.update(status=10)
             paypalrestsdk.configure(PAYPAL_CRD)
             paypalrestsdk.configure(PAYPAL_CRD)
@@ -915,8 +914,8 @@ class CloudStorageView(View):
             payres = payment.execute({"payer_id": PayerID})
             payres = payment.execute({"payer_id": PayerID})
             print(payres)
             print(payres)
             if not payres:
             if not payres:
-                red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
-                return response.json(0, red_url)
+                red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
+                return HttpResponseRedirect(red_url)
             print("Payment execute successfully")
             print("Payment execute successfully")
 
 
             nowTime = int(time.time())
             nowTime = int(time.time())
@@ -962,14 +961,14 @@ class CloudStorageView(View):
             order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
             order_qs.update(status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
 
 
             # return response.json(0)
             # return response.json(0)
-            red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
-            return response.json(0, red_url)
+            red_url = "{SERVER_DOMAIN}web/paid2/success.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
+            return HttpResponseRedirect(red_url)
         except Exception as e:
         except Exception as e:
             if order_qs:
             if order_qs:
                 order_qs.update(status=10)
                 order_qs.update(status=10)
 
 
-            red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
-            return response.json(0, red_url)
+            red_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
+            return HttpResponseRedirect(red_url)
 
 
     def do_pay_by_wechat_callback(self, request, response):
     def do_pay_by_wechat_callback(self, request, response):
 
 
@@ -1099,7 +1098,7 @@ class CloudStorageView(View):
                 format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
                 format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
             # call_sub_url = "http://192.168.136.40:8077/cloudstorage/payExecute?orderID={orderID}".format(
             # call_sub_url = "http://192.168.136.40:8077/cloudstorage/payExecute?orderID={orderID}".format(
             #     SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
             #     SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
-            call_clc_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
+            call_clc_url = "{SERVER_DOMAIN}web/paid2/fail.html".format(SERVER_DOMAIN=SERVER_DOMAIN)
             paypalrestsdk.configure(PAYPAL_CRD)
             paypalrestsdk.configure(PAYPAL_CRD)
             payment = paypalrestsdk.Payment({
             payment = paypalrestsdk.Payment({
                 "intent": "sale",
                 "intent": "sale",
@@ -1137,7 +1136,7 @@ class CloudStorageView(View):
                     out_trade_no=orderID,
                     out_trade_no=orderID,
                     total_amount=price,
                     total_amount=price,
                     subject=subject,
                     subject=subject,
-                    return_url="{SERVER_DOMAIN_SSL}cloudstorage/payOK".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL),
+                    return_url="{SERVER_DOMAIN}web/paid2/success.html".format(SERVER_DOMAIN=SERVER_DOMAIN),
                     notify_url="{SERVER_DOMAIN_SSL}cloudstorage/doalicallback".format(
                     notify_url="{SERVER_DOMAIN_SSL}cloudstorage/doalicallback".format(
                         SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
                         SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
                     # return_url="http://192.168.136.40/cloudstorage/payOK",
                     # return_url="http://192.168.136.40/cloudstorage/payOK",