chenshibin 4 жил өмнө
parent
commit
f1160fcc43

+ 4 - 4
Controller/CloudStorage.py

@@ -906,7 +906,7 @@ class CloudStorageView(View):
 
 
             if not orderID:
             if not orderID:
                 red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
                 red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
-                return HttpResponseRedirect(red_url)
+                return response.json(0, red_url)
             else:
             else:
                 order_qs.update(status=10)
                 order_qs.update(status=10)
             paypalrestsdk.configure(PAYPAL_CRD)
             paypalrestsdk.configure(PAYPAL_CRD)
@@ -916,7 +916,7 @@ class CloudStorageView(View):
             print(payres)
             print(payres)
             if not payres:
             if not payres:
                 red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
                 red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
-                return HttpResponseRedirect(red_url)
+                return response.json(0, red_url)
             print("Payment execute successfully")
             print("Payment execute successfully")
 
 
             nowTime = int(time.time())
             nowTime = int(time.time())
@@ -963,13 +963,13 @@ class CloudStorageView(View):
 
 
             # return response.json(0)
             # return response.json(0)
             red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
             red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
-            return HttpResponseRedirect(red_url)
+            return response.json(0, 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)
             red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
-            return HttpResponseRedirect(red_url)
+            return response.json(0, red_url)
 
 
     def do_pay_by_wechat_callback(self, request, response):
     def do_pay_by_wechat_callback(self, request, response):