set apple_sub.product_id

This commit is contained in:
Son 2021-12-30 16:20:31 +01:00
parent e1d82b7e0d
commit a6f5b755aa
1 changed files with 3 additions and 0 deletions

View File

@ -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()