lang 4 years ago
parent
commit
89afd3fb92
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Controller/CloudStorage.py

+ 5 - 0
Controller/CloudStorage.py

@@ -805,6 +805,7 @@ class CloudStorageView(View):
         PayerID = request_dict.get('PayerID', None)
         orderID = request_dict.get('orderID', None)
         lang = request_dict.get('lang', 'en')
+        file_handle=open('/web/www/AnsjerFormal/static/log/info.log',mode='w')
         try:
             order_qs = Order_Model.objects.filter(orderID=orderID, status=0)
 
@@ -821,6 +822,8 @@ class CloudStorageView(View):
             payres = payment.execute({"payer_id": PayerID})
             print(payres)
             if not payres:
+                file_handle.write('----pal----payres')
+                file_handle.write(payres)
                 red_url = "{SERVER_DOMAIN_SSL}web/paid2/fail.html".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
                 if lang != 'cn':
                     red_url = "{SERVER_DOMAIN_SSL}web/paid2/en_fail.html".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
@@ -901,6 +904,8 @@ class CloudStorageView(View):
                 return HttpResponseRedirect(red_url)
         except Exception as e:
             print(repr(e))
+            file_handle.write('----pal----repr')
+            file_handle.write(repr(e))
             if order_qs:
                 order_qs.update(status=10)
             red_url = "{SERVER_DOMAIN_SSL}web/paid2/fail.html".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)