|
@@ -453,11 +453,11 @@ class CloudVodView(View):
|
|
|
# 续费流程
|
|
|
nowTime = int(time.time())
|
|
|
# 判断是否存在未完成订单
|
|
|
- hasOrder = Order_Model.objects.filter(UID=uid, channel=channel, addTime__gte=nowTime - 3600, status=0,
|
|
|
- rank_id=rank, userID_id=userID).values('paypal')
|
|
|
- if hasOrder.exists():
|
|
|
- approval_url = hasOrder[0]['paypal']
|
|
|
- return response.json(0, {"redirectUrl": approval_url})
|
|
|
+ # hasOrder = Order_Model.objects.filter(UID=uid, channel=channel, addTime__gte=nowTime - 3600, status=0,
|
|
|
+ # rank_id=rank, userID_id=userID).values('paypal')
|
|
|
+ # if hasOrder.exists():
|
|
|
+ # approval_url = hasOrder[0]['paypal']
|
|
|
+ # return response.json(0, {"redirectUrl": approval_url})
|
|
|
# 新增流程
|
|
|
orderID = CommonService.createOrderID()
|
|
|
call_sub_url = "{SERVER_DOMAIN}cloudVod/payExecute?orderID={orderID}". \
|
|
@@ -465,8 +465,6 @@ class CloudVodView(View):
|
|
|
# call_sub_url = "http://192.168.136.40:8077/cloudVod/payExecute?orderID={orderID}".format(
|
|
|
# SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
|
call_clc_url = "{SERVER_DOMAIN}cloudVod/payError".format(SERVER_DOMAIN=SERVER_DOMAIN)
|
|
|
- # call_clc_url = "{SERVER_DOMAIN}cloudVod/cancleorder?orderID={orderID}". \
|
|
|
- # format(SERVER_DOMAIN=SERVER_DOMAIN, orderID=orderID)
|
|
|
paypalrestsdk.configure(PAYPAL_CRD)
|
|
|
payment = paypalrestsdk.Payment({
|
|
|
"intent": "sale",
|
|
@@ -643,8 +641,6 @@ 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 execute successfully")
|
|
|
order_qs = Order_Model.objects.filter(orderID=orderID)
|
|
|
nowTime = int(time.time())
|