chanjunkai 5 years ago
parent
commit
10e75159cf
1 changed files with 13 additions and 13 deletions
  1. 13 13
      Controller/CloudStorage.py

+ 13 - 13
Controller/CloudStorage.py

@@ -8,7 +8,7 @@
 @DATE: 2018/12/5 9:30
 @DATE: 2018/12/5 9:30
 @Version: python3.6
 @Version: python3.6
 @MODIFY DECORD:ansjer dev
 @MODIFY DECORD:ansjer dev
-@file: CloudVod.py
+@file: cloudstorage.py
 @Contact: chanjunkai@163.com
 @Contact: chanjunkai@163.com
 """
 """
 import json
 import json
@@ -34,7 +34,7 @@ from Object.UidTokenObject import UidTokenObject
 from Service.CommonService import CommonService
 from Service.CommonService import CommonService
 from Object.m3u8generate import PlaylistGenerator
 from Object.m3u8generate import PlaylistGenerator
 
 
-SERVER_DOMAIN = 'http://cloudstroage.dvema.com/'
+SERVER_DOMAIN = 'http://test.dvema.com/'
 
 
 '''
 '''
 eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiIxNTY3NzU4MjE4NjE5MTM4MDAxMzgwMDAiLCJleHAiOjE1ODk1MjM0OTIsIm1fY29kZSI6IjEyMzQxMzI0MzIxNCIsImxhbmciOiJlbiIsInVzZXIiOiIxMzExOTY1NzcxMyJ9.e2NdhJtbXrDngZTSmOX_52Y-oxyfUEXjZD_qNxg6VrU
 eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOiIxNTY3NzU4MjE4NjE5MTM4MDAxMzgwMDAiLCJleHAiOjE1ODk1MjM0OTIsIm1fY29kZSI6IjEyMzQxMzI0MzIxNCIsImxhbmciOiJlbiIsInVzZXIiOiIxMzExOTY1NzcxMyJ9.e2NdhJtbXrDngZTSmOX_52Y-oxyfUEXjZD_qNxg6VrU
@@ -653,7 +653,7 @@ class CloudStorageView(View):
                 uid_bucket_id = ub_cqs.id
                 uid_bucket_id = ub_cqs.id
             order_qs.update \
             order_qs.update \
                 (payTime=nowTime, status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
                 (payTime=nowTime, status=1, updTime=nowTime, uid_bucket_id=uid_bucket_id)
-            red_url = "{SERVER_DOMAIN}cloudVod/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
+            red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
             return HttpResponseRedirect(red_url)
             return HttpResponseRedirect(red_url)
         return response.json(0, signature)
         return response.json(0, signature)
 
 
@@ -662,7 +662,7 @@ class CloudStorageView(View):
         PayerID = request_dict.get('PayerID', None)
         PayerID = request_dict.get('PayerID', None)
         orderID = request_dict.get('orderID', None)
         orderID = request_dict.get('orderID', None)
         if not paymentId or not PayerID or not orderID:
         if not paymentId or not PayerID or not orderID:
-            red_url = "{SERVER_DOMAIN}cloudVod/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
+            red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
             return HttpResponseRedirect(red_url)
             return HttpResponseRedirect(red_url)
         paypalrestsdk.configure(PAYPAL_CRD)
         paypalrestsdk.configure(PAYPAL_CRD)
         # ID of the payment. This ID is provided when creating payment.
         # ID of the payment. This ID is provided when creating payment.
@@ -670,7 +670,7 @@ 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}cloudVod/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
+            red_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
             return HttpResponseRedirect(red_url)
             return HttpResponseRedirect(red_url)
         print("Payment execute successfully")
         print("Payment execute successfully")
         order_qs = Order_Model.objects.filter(orderID=orderID)
         order_qs = Order_Model.objects.filter(orderID=orderID)
@@ -701,7 +701,7 @@ 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}cloudVod/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
+        red_url = "{SERVER_DOMAIN}cloudstorage/payOK".format(SERVER_DOMAIN=SERVER_DOMAIN)
         return HttpResponseRedirect(red_url)
         return HttpResponseRedirect(red_url)
 
 
     def do_create_pay_order(self, request_dict, userID, response):
     def do_create_pay_order(self, request_dict, userID, response):
@@ -730,11 +730,11 @@ class CloudStorageView(View):
         nowTime = int(time.time())
         nowTime = int(time.time())
         orderID = CommonService.createOrderID()
         orderID = CommonService.createOrderID()
         if pay_type == 0:
         if pay_type == 0:
-            call_sub_url = "{SERVER_DOMAIN}cloudVod/dopaypalcallback?orderID={orderID}". \
+            call_sub_url = "{SERVER_DOMAIN}cloudstorage/dopaypalcallback?orderID={orderID}". \
                 format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
                 format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
-            # call_sub_url = "http://192.168.136.40:8077/cloudVod/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}cloudVod/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
+            call_clc_url = "{SERVER_DOMAIN}cloudstorage/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
             paypalrestsdk.configure(PAYPAL_CRD)
             paypalrestsdk.configure(PAYPAL_CRD)
             payment = paypalrestsdk.Payment({
             payment = paypalrestsdk.Payment({
                 "intent": "sale",
                 "intent": "sale",
@@ -771,10 +771,10 @@ 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}cloudVod/payOK".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL),
-                    notify_url="{SERVER_DOMAIN_SSL}cloudVod/doalicallback".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
-                    # return_url="http://192.168.136.40/cloudVod/payOK",
-                    # notify_url="http://192.168.136.40/cloudVod/aliPayCallback"
+                    return_url="{SERVER_DOMAIN_SSL}cloudstorage/payOK".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL),
+                    notify_url="{SERVER_DOMAIN_SSL}cloudstorage/doalicallback".format(SERVER_DOMAIN_SSL=SERVER_DOMAIN_SSL)
+                    # return_url="http://192.168.136.40/cloudstorage/payOK",
+                    # notify_url="http://192.168.136.40/cloudstorage/aliPayCallback"
                 )
                 )
             except Exception as e:
             except Exception as e:
                 print(repr(e))
                 print(repr(e))