|
@@ -96,6 +96,17 @@ class InAppPurchaseView(View):
|
|
|
redis_obj.CONN.expire(redis_key, 60)
|
|
|
|
|
|
try:
|
|
|
+ order_qs = Order_Model.objects.filter(orderID=order_id, UID=uid).values("rank_id", "transaction_id")
|
|
|
+
|
|
|
+ if not order_qs.exists():
|
|
|
+ return response.json(173, "订单不存在")
|
|
|
+ if order_qs[0]["transaction_id"]:
|
|
|
+ return response.json(0)
|
|
|
+ if UID_Bucket.objects.filter(orderId=order_id).exists():
|
|
|
+ return response.json(0)
|
|
|
+ if Unused_Uid_Meal.objects.filter(order_id=order_id).exists():
|
|
|
+ return response.json(0)
|
|
|
+
|
|
|
# 从交易信息中获取product_id
|
|
|
key_path = '{}/Ansjer/file/in_app_purchase/SubscriptionKey_N42WMFCV6A.p8'.format(BASE_DIR)
|
|
|
with open(key_path, 'rb') as file:
|
|
@@ -117,17 +128,6 @@ class InAppPurchaseView(View):
|
|
|
return response.json(0, {'url': pay_result_url})
|
|
|
logger.info(f"苹果内购认证交易订单orderID:{order_id}, transaction_id:{transaction_id}, 时间戳: {int(time.time())}")
|
|
|
|
|
|
- order_qs = Order_Model.objects.filter(orderID=order_id, UID=uid).values("rank_id", "transaction_id")
|
|
|
-
|
|
|
- if not order_qs.exists():
|
|
|
- return response.json(173, "订单不存在")
|
|
|
- if order_qs[0]["transaction_id"]:
|
|
|
- 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, "订单已充值")
|
|
|
-
|
|
|
OrderPayLog.objects.create(order_id=order_id, order_no=transaction_id,
|
|
|
business_name=f"内购验单",
|
|
|
created_time=int(time.time()), updated_time=int(time.time()),
|