|
@@ -379,16 +379,17 @@ class InAppPurchaseView(View):
|
|
if orders_qs.exists():
|
|
if orders_qs.exists():
|
|
orderID = orders_qs[0].orderID
|
|
orderID = orders_qs[0].orderID
|
|
uid = orders_qs[0].UID
|
|
uid = orders_qs[0].UID
|
|
|
|
+ app_type = orders_qs[0].app_type
|
|
now_time = int(time.time())
|
|
now_time = int(time.time())
|
|
put_time = int(now_time + 11.5 * 60 * 60)
|
|
put_time = int(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)
|
|
if in_app_refund_qs.exists():
|
|
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=1, created_time=now_time,
|
|
|
|
- updated_time=now_time, put_time=put_time,
|
|
|
|
- app_account_token=app_account_token)
|
|
|
|
|
|
+ in_app_refund_qs.update(refund_progress=0, 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)
|
|
elif CONFIG_INFO == CONFIG_US:
|
|
elif CONFIG_INFO == CONFIG_US:
|
|
url = "https://api.zositeche.com/inAppPurchase/AppStoreServerNotifications"
|
|
url = "https://api.zositeche.com/inAppPurchase/AppStoreServerNotifications"
|
|
eur_response = requests.post(url=url, json=json.loads(request.body))
|
|
eur_response = requests.post(url=url, json=json.loads(request.body))
|