Browse Source

update field

lang 4 năm trước cách đây
mục cha
commit
7ad99017a3
1 tập tin đã thay đổi với 14 bổ sung14 xóa
  1. 14 14
      Controller/CloudStorage.py

+ 14 - 14
Controller/CloudStorage.py

@@ -918,18 +918,18 @@ class CloudStorageView(View):
         paymentId = request_dict.get('paymentId', None)
         PayerID = request_dict.get('PayerID', None)
         orderID = request_dict.get('orderID', None)
-        if not paymentId or not PayerID or not orderID:
-            red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
-            return HttpResponseRedirect(red_url)
-        paypalrestsdk.configure(PAYPAL_CRD)
-        # ID of the payment. This ID is provided when creating payment.
-        payment = paypalrestsdk.Payment.find(paymentId)
-        payres = payment.execute({"payer_id": PayerID})
-        print(payres)
-        if not payres:
-            red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
-            return HttpResponseRedirect(red_url)
-        print("Payment execute successfully")
+        # if not paymentId or not PayerID or not orderID:
+        #     red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
+        #     return HttpResponseRedirect(red_url)
+        # paypalrestsdk.configure(PAYPAL_CRD)
+        # # ID of the payment. This ID is provided when creating payment.
+        # payment = paypalrestsdk.Payment.find(paymentId)
+        # payres = payment.execute({"payer_id": PayerID})
+        # print(payres)
+        # if not payres:
+        #     red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
+        #     return HttpResponseRedirect(red_url)
+        # print("Payment execute successfully")
         order_qs = Order_Model.objects.filter(orderID=orderID)
         nowTime = int(time.time())
         order_list = order_qs.values("UID", "channel", "commodity_code", "rank", "isSelectDiscounts", "userID__userID",
@@ -963,7 +963,7 @@ class CloudStorageView(View):
                 (uid=UID, channel=channel, bucket_id=bucketId, endTime=endTime, addTime=nowTime, updateTime=nowTime)
             uid_bucket_id = ub_cqs.id
 
-        dvq = Device_Info.objects.filter(uid=UID, primaryUserID='', primaryMaster='')
+        dvq = Device_Info.objects.filter(UID=UID, primaryUserID='', primaryMaster='')
         if dvq.exists():
             dvq_set_update_dict = {
                 'primaryUserID': userid,
@@ -1017,7 +1017,7 @@ class CloudStorageView(View):
                     (uid=UID, channel=channel, bucket_id=bucketId, endTime=endTime, addTime=nowTime, updateTime=nowTime)
                 uid_bucket_id = ub_cqs.id
 
-            dvq = Device_Info.objects.filter(uid=UID, primaryUserID='', primaryMaster='')
+            dvq = Device_Info.objects.filter(UID=UID, primaryUserID='', primaryMaster='')
             if dvq.exists():
                 dvq_set_update_dict = {
                     'primaryUserID': userid,