|
@@ -305,14 +305,17 @@ class PaypalCycleNotify(View):
|
|
# 订阅续费订单(如果完成周期数`不是0, 则说明是续费订单,)
|
|
# 订阅续费订单(如果完成周期数`不是0, 则说明是续费订单,)
|
|
if billing_agreement.agreement_details.cycles_completed == '0':
|
|
if billing_agreement.agreement_details.cycles_completed == '0':
|
|
return HttpResponse('success')
|
|
return HttpResponse('success')
|
|
- orderID = billing_agreement.description
|
|
|
|
- order_qs = Order_Model.objects.filter(orderID=orderID, status=1)
|
|
|
|
|
|
+ oldOrderID = billing_agreement.description
|
|
|
|
+ order_qs = Order_Model.objects.filter(orderID=oldOrderID, status=1)
|
|
if not order_qs:
|
|
if not order_qs:
|
|
return HttpResponse('fail')
|
|
return HttpResponse('fail')
|
|
order_list = order_qs.values("UID", "channel", "commodity_code", "rank", "isSelectDiscounts",
|
|
order_list = order_qs.values("UID", "channel", "commodity_code", "rank", "isSelectDiscounts",
|
|
"userID__userID","uid_bucket_id",
|
|
"userID__userID","uid_bucket_id",
|
|
- "userID__username",'plan_id','addTime','desc','payType','currency','commodity_type')
|
|
|
|
|
|
+ "userID__username",'plan_id','addTime','desc','payType','currency','commodity_type','updTime')
|
|
nowTime = int(time.time())
|
|
nowTime = int(time.time())
|
|
|
|
+ if order_list[0]['userID__userID'] + 9200 > nowTime: #避免续费订单重复支付
|
|
|
|
+ return HttpResponse('success')
|
|
|
|
+
|
|
userid = order_list[0]['userID__userID']
|
|
userid = order_list[0]['userID__userID']
|
|
username = order_list[0]['userID__username']
|
|
username = order_list[0]['userID__username']
|
|
UID = order_list[0]['UID']
|
|
UID = order_list[0]['UID']
|
|
@@ -401,6 +404,19 @@ class PaypalCycleNotify(View):
|
|
sys_msg_text_list, 'SMS_219738485')
|
|
sys_msg_text_list, 'SMS_219738485')
|
|
logger.info('-----------------------result')
|
|
logger.info('-----------------------result')
|
|
logger.info('success')
|
|
logger.info('success')
|
|
|
|
+
|
|
|
|
+ #更新agreement
|
|
|
|
+ billing_agreement_update_attributes = [
|
|
|
|
+ {
|
|
|
|
+ "op": "replace",
|
|
|
|
+ "path": "/",
|
|
|
|
+ "value": {
|
|
|
|
+ "description": orderID,
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ billing_agreement.replace(billing_agreement_update_attributes)
|
|
|
|
+
|
|
return HttpResponse('success')
|
|
return HttpResponse('success')
|
|
except Exception as e:
|
|
except Exception as e:
|
|
print(e)
|
|
print(e)
|