Procházet zdrojové kódy

苹果内购验单防止订单重复

linhaohong před 9 měsíci
rodič
revize
6142120b17
1 změnil soubory, kde provedl 7 přidání a 0 odebrání
  1. 7 0
      Controller/InAppPurchaseController.py

+ 7 - 0
Controller/InAppPurchaseController.py

@@ -136,6 +136,13 @@ class InAppPurchaseView(View):
                                        created_time=int(time.time()), updated_time=int(time.time()),
                                        access_result="SUCCESS")
 
+            if Order_Model.objects.filter(orderID=order_id, transaction_id=transaction_id).exists():
+                return response.json(174, "订单已支付充值")
+            if UID_Bucket.objects.filter(orderId=order_id).exists():
+                return response.json(174, "订单已充值")
+            if Unused_Uid_Meal.objects.filter(order_id=order_id).exists():
+                return response.json(174, "订单已充值")
+
             # 查询交易信息
             attempts = 0
             while attempts < 6: