Переглянути джерело

交易号已存在不自动续费

locky 2 місяців тому
батько
коміт
803cf706ee
1 змінених файлів з 6 додано та 1 видалено
  1. 6 1
      Controller/PaymentCycle.py

+ 6 - 1
Controller/PaymentCycle.py

@@ -558,9 +558,14 @@ class PaypalCycleNotify(View):
                 PAY_LOGGER.info('{} PayPal周期扣款首次扣款成功'.format(UID))
                 return HttpResponse('success')
 
-            if order_qs[0]['addTime'] + 9200 > nowTime:  # 避免续费订单重复支付
+            # 避免续费订单重复支付
+            if order_qs[0]['addTime'] + 9200 > nowTime:
                 PAY_LOGGER.info('{} PayPal周期扣款失败---续费订单已创建'.format(UID))
                 return HttpResponse('success')
+            repeat_order = Order_Model.objects.filter(trade_no=paypal_transaction_id, status=1)
+            if repeat_order.exists():
+                PAY_LOGGER.info('{} PayPal周期扣款失败---交易号已存在'.format(UID))
+                return HttpResponse('success')
 
             desc = order_qs[0]['desc']
             pay_type = order_qs[0]['payType']