|
@@ -679,14 +679,18 @@ class InAppPurchaseView(View):
|
|
|
uid = orders_qs[0].UID
|
|
|
now_time = int(time.time())
|
|
|
put_time = now_time + 11.5 * 60 * 60
|
|
|
- in_app_refund_qs = InAppRefund.objects.filter(transaction_id=transaction_id)
|
|
|
+ in_app_refund_qs = InAppRefund.objects.filter(transaction_id=transaction_id).values("refund_progress")
|
|
|
if in_app_refund_qs.exists():
|
|
|
- in_app_refund_qs.update(refund_progress=0, updated_time=now_time,
|
|
|
- put_time=put_time, app_account_token=app_account_token)
|
|
|
- InAppRefund.objects.create(transaction_id=transaction_id, orderID=orderID,
|
|
|
- uid=uid, app_type=app_type, created_time=now_time,
|
|
|
- updated_time=now_time, put_time=put_time,
|
|
|
- app_account_token=app_account_token)
|
|
|
+ if in_app_refund_qs[0]["refund_progress"] == 4:
|
|
|
+ in_app_refund_qs.update(refund_progress=0, updated_time=now_time,
|
|
|
+ put_time=put_time, app_account_token=app_account_token)
|
|
|
+ else:
|
|
|
+ in_app_refund_qs.update(updated_time=now_time, app_account_token=app_account_token)
|
|
|
+ else:
|
|
|
+ InAppRefund.objects.create(transaction_id=transaction_id, orderID=orderID,
|
|
|
+ uid=uid, app_type=app_type, created_time=now_time,
|
|
|
+ updated_time=now_time, put_time=put_time,
|
|
|
+ app_account_token=app_account_token)
|
|
|
return HttpResponse(status=200)
|
|
|
|
|
|
elif str(decoded_payload.rawNotificationType) == "DID_CHANGE_RENEWAL_STATUS":
|
|
@@ -764,7 +768,7 @@ class InAppPurchaseView(View):
|
|
|
orders_qs = Order_Model.objects.filter(transaction_id=transaction_id)
|
|
|
if not orders_qs.exists():
|
|
|
return HttpResponse(status=400)
|
|
|
- InAppRefund.objects.filter(transaction_id=transaction_id).update(refund_progress=3)
|
|
|
+ InAppRefund.objects.filter(transaction_id=transaction_id).update(refund_progress=3, updated_time=int(time.time()))
|
|
|
|
|
|
else:
|
|
|
logger.info(f"App Store服务器通知decoded_payload.rawNotificationType 未处理")
|