Ver Fonte

paypai 回调返回

chenshibin há 4 anos atrás
pai
commit
f1160fcc43
1 ficheiros alterados com 4 adições e 4 exclusões
  1. 4 4
      Controller/CloudStorage.py

+ 4 - 4
Controller/CloudStorage.py

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