Add HTTPS requirement for production Stripe account links

mailing
Razmig Sarkissian 1 month ago
parent 4826b4b8b7
commit de5cd64679
  1. 7
      api/views.py

@ -520,7 +520,12 @@ def create_stripe_account_link(request):
}, status=400)
try:
base_path = f"{request.scheme}://{request.get_host()}"
# Force HTTPS for production Stripe calls
if hasattr(settings, 'STRIPE_MODE') and settings.STRIPE_MODE == 'live':
base_path = f"https://{request.get_host()}"
else:
base_path = f"{request.scheme}://{request.get_host()}"
print("create_stripe_account_link", base_path)
refresh_url = f"{base_path}/stripe-refresh-account-link/"
return_url = f"{base_path}/stripe-onboarding-complete/"

Loading…
Cancel
Save