mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Fix registering subscription payment failures
This commit is contained in:
@@ -52,9 +52,9 @@ async def subscribe(request: Request):
|
|||||||
# Verify product ID if official_product_id is configured
|
# Verify product ID if official_product_id is configured
|
||||||
if official_product_id:
|
if official_product_id:
|
||||||
# Get the product ID from the subscription items
|
# Get the product ID from the subscription items
|
||||||
subscription_items = subscription.get("items", {}).get("data", [])
|
subscription_items = (subscription.get("items") or subscription.get("lines", {})).get("data", [])
|
||||||
if not subscription_items:
|
if not subscription_items:
|
||||||
logger.warning(f"No subscription items found for event {event['id']}")
|
logger.warning(f"No subscription lines/items found for event {event['id']}")
|
||||||
return {"success": False}
|
return {"success": False}
|
||||||
|
|
||||||
# Check if any subscription item matches the official product ID
|
# Check if any subscription item matches the official product ID
|
||||||
|
|||||||
Reference in New Issue
Block a user