|
@@ -457,10 +457,6 @@ class PaypalCycleNotify(View):
|
|
|
# 检查是否云服务代理订单
|
|
|
order_id = order_qs[0]['orderID']
|
|
|
rank = order_qs[0]['rank_id']
|
|
|
- check_thread = threading.Thread(
|
|
|
- target=AgentOrderView.check_agent_service_package, args=(order_id, uid, rank)
|
|
|
- )
|
|
|
- check_thread.start()
|
|
|
|
|
|
if order_qs[0]['create_vod']:
|
|
|
order_qs.update(status=1, trade_no=paypal_transaction_id, updTime=nowTime, fee=fee)
|
|
@@ -491,8 +487,16 @@ class PaypalCycleNotify(View):
|
|
|
# 核销coupon
|
|
|
if coupon_id:
|
|
|
CouponModel.objects.filter(id=coupon_id).update(use_status=2, update_time=nowTime)
|
|
|
-
|
|
|
- PAY_LOGGER.info('PayPal周期扣款成功---更新交易id:{}'.format(paypal_transaction_id))
|
|
|
+ # PayPal支付成功后异步检查是否代理订单
|
|
|
+ try:
|
|
|
+ check_thread = threading.Thread(
|
|
|
+ target=AgentOrderView.check_agent_service_package, args=(order_id, uid, rank)
|
|
|
+ )
|
|
|
+ check_thread.start()
|
|
|
+ except Exception as e:
|
|
|
+ PAY_LOGGER.error('PayPal周期扣款异步检查代理订单失败,order_id:{},e:{}'.format(order_id, repr(e)))
|
|
|
+
|
|
|
+ PAY_LOGGER.info('PayPal周期扣款成功{}---更新交易id:{}'.format(order_id, paypal_transaction_id))
|
|
|
return HttpResponse('success')
|
|
|
else:
|
|
|
PAY_LOGGER.info('PayPal周期扣款失败---paymentID:{}或paypal_transaction_id:{}为空'.
|
|
@@ -573,6 +577,14 @@ class PaypalCycleNotify(View):
|
|
|
# 核销coupon
|
|
|
if coupon_id:
|
|
|
CouponModel.objects.filter(id=coupon_id).update(use_status=2, update_time=nowTime)
|
|
|
+ # PayPal首次扣款异步检查是否代理订单
|
|
|
+ try:
|
|
|
+ check_thread = threading.Thread(
|
|
|
+ target=AgentOrderView.check_agent_service_package, args=(order_id, UID, rank)
|
|
|
+ )
|
|
|
+ check_thread.start()
|
|
|
+ except Exception as e:
|
|
|
+ PAY_LOGGER.error('{}PayPal周期扣款首次异步检查代理订单失败:{}'.format(order_id, repr(e)))
|
|
|
PAY_LOGGER.info('{} PayPal周期扣款首次扣款成功'.format(UID))
|
|
|
return HttpResponse('success')
|
|
|
|
|
@@ -686,13 +698,16 @@ class PaypalCycleNotify(View):
|
|
|
PaypalWebHookEvent.objects.filter(id=paypal_webhook_event_qs.id).update(newOrderID=orderID,
|
|
|
update_status=update_status)
|
|
|
|
|
|
- # 检查是否云服务代理订单
|
|
|
- check_thread = threading.Thread(
|
|
|
- target=AgentOrderView.check_agent_service_package, args=(orderID, UID, rank)
|
|
|
- )
|
|
|
- check_thread.start()
|
|
|
+ # PayPal检查是否云服务代理订单
|
|
|
+ try:
|
|
|
+ check_thread = threading.Thread(
|
|
|
+ target=AgentOrderView.check_agent_service_package, args=(orderID, UID, rank)
|
|
|
+ )
|
|
|
+ check_thread.start()
|
|
|
+ except Exception as e:
|
|
|
+ PAY_LOGGER.error('{}PayPal周期扣款检查代理订单失败:{}'.format(order_id, repr(e)))
|
|
|
|
|
|
- PAY_LOGGER.info('{} PayPal周期扣款成功'.format(UID))
|
|
|
+ PAY_LOGGER.info('{} PayPal周期扣款成功{}'.format(UID, orderID))
|
|
|
return HttpResponse('success')
|
|
|
except Exception as e:
|
|
|
PAY_LOGGER.info('PayPal周期扣款异常: errLine:{}, errMsg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|