Skip to content

Commit f23b273

Browse files
LEANDERANTONYclaude
andcommitted
Fix: LS hosted checkout URL path is /checkout/buy/<variant>
Mirror of HelpmateAI commit 8016457 (Codex P1 finding on HelpmateAI's PR #4). The LS scaffold for both apps was built from the same template, so the same URL bug exists here too — even though Codex didn't flag it on AI Job Agent's PR #2 (Codex's review surfaces sample issues rather than every instance). Old: https://<store>.lemonsqueezy.com/buy/<variant> New: https://<store>.lemonsqueezy.com/checkout/buy/<variant> Per the LS docs at docs.lemonsqueezy.com/help/checkout/hosted-checkouts, the `/buy/` path is a non-checkout endpoint. Every Pro upgrade CTA would have resolved there and failed silently the moment LS goes live with real variant IDs. This fix lands BEFORE KYC clears so the broken state never reaches paid customers. No test changes — the helper is exercised in real LS sandbox testing which happens post-merge once variant IDs exist. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b8fb594 commit f23b273

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

frontend/src/lib/api.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,13 @@ export async function getWorkspaceQuota() {
423423
//
424424
// The hosted checkout URL pattern is documented at
425425
// https://docs.lemonsqueezy.com/help/checkout/hosted-checkouts.
426-
// Format: https://{store_subdomain}.lemonsqueezy.com/buy/{variant_uuid}
426+
// Format: https://{store_subdomain}.lemonsqueezy.com/checkout/buy/{variant_uuid}
427+
// An earlier draft used `/buy/<variant>` which is a non-checkout
428+
// endpoint (Codex P1 finding on HelpmateAI's PR #4, mirrored here
429+
// because the LS scaffold for both apps was built from the same
430+
// template). Paid conversion fails the moment LS goes live with the
431+
// wrong path, so this fix lands BEFORE KYC clears.
432+
//
427433
// We append checkout[custom][user_id] so the LS webhook can bind the
428434
// subscription back to our Supabase user. Without that binding the
429435
// webhook handler has no way to write the right row.
@@ -476,7 +482,7 @@ export function getCheckoutUrl(
476482
? LEMONSQUEEZY_VARIANT_PRO
477483
: LEMONSQUEEZY_VARIANT_BUSINESS;
478484
if (!variant) return "";
479-
const base = `https://${LEMONSQUEEZY_STORE_ID}.lemonsqueezy.com/buy/${variant}`;
485+
const base = `https://${LEMONSQUEEZY_STORE_ID}.lemonsqueezy.com/checkout/buy/${variant}`;
480486
if (!userId) return base;
481487
// LS expects checkout fields as URL-encoded query params; the
482488
// bracket syntax is the documented form for nested fields.

0 commit comments

Comments
 (0)