From a6f5b755aa4499245b533021279c5eebdd66be5f Mon Sep 17 00:00:00 2001 From: Son Date: Thu, 30 Dec 2021 16:20:31 +0100 Subject: [PATCH] set apple_sub.product_id --- app/api/views/apple.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/api/views/apple.py b/app/api/views/apple.py index d46a9f21..4f68a6cb 100644 --- a/app/api/views/apple.py +++ b/app/api/views/apple.py @@ -279,6 +279,7 @@ def apple_update_notification(): apple_sub.receipt_data = data["unified_receipt"]["latest_receipt"] apple_sub.expires_date = expires_date apple_sub.plan = plan + apple_sub.product_id = transaction["product_id"] Session.commit() return jsonify(ok=True), 200 else: @@ -526,6 +527,7 @@ def verify_receipt(receipt_data, user, password) -> Optional[AppleSubscription]: apple_sub.receipt_data = receipt_data apple_sub.expires_date = expires_date apple_sub.original_transaction_id = original_transaction_id + apple_sub.product_id = latest_transaction["product_id"] apple_sub.plan = plan else: # the same original_transaction_id has been used on another account @@ -545,6 +547,7 @@ def verify_receipt(receipt_data, user, password) -> Optional[AppleSubscription]: expires_date=expires_date, original_transaction_id=original_transaction_id, plan=plan, + product_id=latest_transaction["product_id"], ) Session.commit()