|
@@ -473,7 +473,7 @@ class CloudVodView(View):
|
|
|
if not paymentId or not PayerID or not orderID:
|
|
|
red_url = "{SERVER_DOMAIN}cloudVod/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
- return response.json(444, 'paymentId,PayerID,orderID')
|
|
|
+ # return response.json(444, 'paymentId,PayerID,orderID')
|
|
|
paypalrestsdk.configure({
|
|
|
"mode": "sandbox", # sandbox or live
|
|
|
"client_id": "AfnfDqezODOoWGS-W2Itu-Zl1ay1R95IsGlMqPghPA3KGhkPndNMnQT0bdEewvSv92XAFIfLiinmyhBL",
|
|
@@ -486,8 +486,8 @@ class CloudVodView(View):
|
|
|
if not payres:
|
|
|
red_url = "{SERVER_DOMAIN}cloudVod/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
return HttpResponseRedirect(red_url)
|
|
|
- print(payment.error) # Error Hash
|
|
|
- return response.json(10, payment.error)
|
|
|
+ # print(payment.error) # Error Hash
|
|
|
+ # return response.json(10, payment.error)
|
|
|
print("Payment execute successfully")
|
|
|
order_qs = Order_Model.objects.filter(orderID=orderID)
|
|
|
order_qs.update(status=1, updTime=CommonService.get_utc())
|
|
@@ -514,14 +514,15 @@ class CloudVodView(View):
|
|
|
if ubqs[0]['bucket__storeDay'] > smqs[0]['bucket__storeDay']:
|
|
|
return response.json(10, '不可降级')
|
|
|
else:
|
|
|
+ # 升级
|
|
|
origin_storeDay = int(ubqs[0]['bucket__storeDay'])
|
|
|
upgrade_storeDay = int(smqs[0]['bucket__storeDay'])
|
|
|
ctcTime = ubqs[0]['endTime'] - nowTime
|
|
|
multiple = math.ceil(upgrade_storeDay / origin_storeDay)
|
|
|
- ubqs.update(endTime=ctcTime / multiple + addTime + ubqs[0]['endTime'])
|
|
|
+ ubqs.update(endTime=ctcTime / multiple + addTime + ubqs[0]['endTime'],bucket_id=bucketId)
|
|
|
# 新增模式
|
|
|
else:
|
|
|
- print('craete')
|
|
|
+ print('create')
|
|
|
UID_Bucket.objects.create(
|
|
|
uid=UID,
|
|
|
channel=channel,
|