Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Add embed_origin to checkout request

Daoud Clarkee86c7c69e0db
diff --git a/mwmbl/platform/api.py b/mwmbl/platform/api.py
index 0f259a9..cb388c0 100644
--- a/mwmbl/platform/api.py
+++ b/mwmbl/platform/api.py
@@ -621,6 +621,8 @@ def create_checkout(request, body: CheckoutRequest):
checkout_params["external_customer_id"] = billing.polar_customer_id
if body.success_url:
checkout_params["success_url"] = body.success_url
+ if body.embed_origin:
+ checkout_params["embed_origin"] = body.embed_origin
with 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.py
index 5856252..a3b3356 100644
--- a/mwmbl/platform/schemas.py
+++ b/mwmbl/platform/schemas.py
@@ -24,6 +24,7 @@ class SubscriptionResponse(Schema):
class CheckoutRequest(Schema):
plan: Literal["starter", "pro"]
success_url: Optional[str] = None
+ embed_origin: Optional[str] = None
class CheckoutResponse(Schema):