An open source, non-profit web search engine
Add success_url when checking out
Daoud Clarke0e05324af762
diff --git a/mwmbl/platform/api.py b/mwmbl/platform/api.pyindex d9d2ec2..0f259a9 100644--- a/mwmbl/platform/api.py+++ b/mwmbl/platform/api.py@@ -619,6 +619,8 @@ def create_checkout(request, body: CheckoutRequest):}if billing and billing.polar_customer_id:checkout_params["external_customer_id"] = billing.polar_customer_id+ if body.success_url:+ checkout_params["success_url"] = body.success_urlwith Polar(access_token=settings.POLAR_ACCESS_TOKEN, server=settings.POLAR_SERVER) as polar:result = polar.checkouts.create(request=checkout_params)return CheckoutResponse(checkout_url=result.url)diff --git a/mwmbl/platform/schemas.py b/mwmbl/platform/schemas.pyindex 39e19a1..5856252 100644--- a/mwmbl/platform/schemas.py+++ b/mwmbl/platform/schemas.py@@ -23,6 +23,7 @@ class SubscriptionResponse(Schema):class CheckoutRequest(Schema):plan: Literal["starter", "pro"]+ success_url: Optional[str] = Noneclass CheckoutResponse(Schema):