mirror of https://github.com/kortix-ai/suna.git
chore(dev): add tolt referrals
This commit is contained in:
parent
63be13e6a6
commit
d49c9e6766
|
@ -39,6 +39,7 @@ class CreateCheckoutSessionRequest(BaseModel):
|
|||
price_id: str
|
||||
success_url: str
|
||||
cancel_url: str
|
||||
tolt_referral: Optional[str] = None
|
||||
|
||||
class CreatePortalSessionRequest(BaseModel):
|
||||
return_url: str
|
||||
|
@ -553,7 +554,8 @@ async def create_checkout_session(
|
|||
cancel_url=request.cancel_url,
|
||||
metadata={
|
||||
'user_id': current_user_id,
|
||||
'product_id': product_id
|
||||
'product_id': product_id,
|
||||
'tolt_referral': request.tolt_referral
|
||||
},
|
||||
allow_promotion_codes=True
|
||||
)
|
||||
|
|
|
@ -18,7 +18,6 @@ export default function PersonalAccountSettingsPage({
|
|||
];
|
||||
return (
|
||||
<>
|
||||
<Script async src="https://cdn.tolt.io/tolt.js" data-tolt="pk_svc8UjqvSEMSSpDuxKH63UmV"></Script>
|
||||
<div className="space-y-6 w-full">
|
||||
<Separator className="border-subtle dark:border-white/10" />
|
||||
<div className="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0 w-full max-w-6xl mx-auto px-4">
|
||||
|
|
|
@ -123,13 +123,12 @@ export default function RootLayout({
|
|||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','GTM-PCHSN4M2');`}
|
||||
</Script>
|
||||
<script async src="https://cdn.tolt.io/tolt.js" data-tolt="pk_svc8UjqvSEMSSpDuxKH63UmV"></script>
|
||||
<Script async src="https://cdn.tolt.io/tolt.js" data-tolt={process.env.NEXT_PUBLIC_TOLT_KEY}></Script>
|
||||
</head>
|
||||
|
||||
<body
|
||||
className={`${geistSans.variable} ${geistMono.variable} antialiased font-sans bg-background`}
|
||||
>
|
||||
{/* Google Tag Manager (noscript) */}
|
||||
<noscript>
|
||||
<iframe
|
||||
src="https://www.googletagmanager.com/ns.html?id=GTM-PCHSN4M2"
|
||||
|
|
|
@ -1590,8 +1590,9 @@ export const createCheckoutSession = async (
|
|||
throw new NoAccessTokenAvailableError();
|
||||
}
|
||||
|
||||
// Add referral ID to request if available
|
||||
const requestBody = { ...request };
|
||||
|
||||
const requestBody = { ...request, tolt_referral: window.tolt_referral };
|
||||
console.log('Tolt Referral ID:', requestBody.tolt_referral);
|
||||
|
||||
const response = await fetch(`${API_URL}/billing/create-checkout-session`, {
|
||||
method: 'POST',
|
||||
|
|
Loading…
Reference in New Issue