summaryrefslogtreecommitdiff
path: root/Biz/PodcastItLater/Billing.py
diff options
context:
space:
mode:
Diffstat (limited to 'Biz/PodcastItLater/Billing.py')
-rw-r--r--Biz/PodcastItLater/Billing.py17
1 files changed, 4 insertions, 13 deletions
diff --git a/Biz/PodcastItLater/Billing.py b/Biz/PodcastItLater/Billing.py
index bf907bf..9f3739d 100644
--- a/Biz/PodcastItLater/Billing.py
+++ b/Biz/PodcastItLater/Billing.py
@@ -212,19 +212,10 @@ def create_portal_session(user_id: int, base_url: str) -> str:
msg = "User has no Stripe customer ID"
raise ValueError(msg)
- try:
- session = stripe.billing_portal.Session.create(
- customer=user["stripe_customer_id"],
- return_url=f"{base_url}/account",
- )
- except Exception as e:
- # Catch Stripe errors (portal not configured, etc.)
- logger.exception("Stripe portal error")
- msg = (
- "Billing portal not configured. "
- "Please contact support or cancel via your account page."
- )
- raise ValueError(msg) from e
+ session = stripe.billing_portal.Session.create(
+ customer=user["stripe_customer_id"],
+ return_url=f"{base_url}/account",
+ )
logger.info(
"Created portal session for user %s: %s",