Jun 28 - Fix bill.stripe.com returns incorrectly
This commit is contained in:
@@ -105,7 +105,8 @@ def subscribe():
|
||||
price_id = plan.stripe_price_id
|
||||
|
||||
# Create Checkout Session AFTER the control_session commits customer_id.
|
||||
base_url = (current_app.config.get('APP_BASE_URL') or request.host_url).rstrip('/')
|
||||
# Use request.host_url so success/cancel redirect back to the tenant's domain.
|
||||
base_url = request.host_url.rstrip('/')
|
||||
try:
|
||||
session = create_checkout_session(
|
||||
customer_id=stripe_customer_id,
|
||||
@@ -147,7 +148,9 @@ def portal():
|
||||
return redirect(url_for('tenant_settings.plan'))
|
||||
stripe_customer_id = t.stripe_customer_id
|
||||
|
||||
base_url = (current_app.config.get('APP_BASE_URL') or request.host_url).rstrip('/')
|
||||
# Use the actual request host so the return URL matches the tenant's domain,
|
||||
# not the global APP_BASE_URL which points to the primary domain.
|
||||
base_url = request.host_url.rstrip('/')
|
||||
return_url = f'{base_url}/settings/plan'
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user