Skip to content

fix(membership): reconcile checkout price/badge + fix mobile overflow#412

Merged
spe1020 merged 1 commit into
mainfrom
fix/membership-checkout-mobile-price
Jun 1, 2026
Merged

fix(membership): reconcile checkout price/badge + fix mobile overflow#412
spe1020 merged 1 commit into
mainfrom
fix/membership-checkout-mobile-price

Conversation

@spe1020
Copy link
Copy Markdown
Contributor

@spe1020 spe1020 commented Jun 1, 2026

What

Lands the membership-checkout fix that was authored alongside the promo engine but did not make it into main — PR #408 merged only the engine commit (32eeee4), leaving the follow-up fix (afe815b) stranded on the old branch. This cherry-picks it cleanly onto current main.

So in production today, the membership Lightning checkouts still have both the mobile overflow and the price/badge mismatch. This fixes both.

Priority 1 — price/badge correctness

  • /api/membership/apply-promo now stacks the 5% BTC discount on the promo-adjusted price and converts to sats with the same pipeline as create-lightning-invoice, returning discountedUsd, amountSats, btcPrice, and totalDiscountPercent.
  • Cook+, Pro Kitchen, and Genesis checkout cards bind USD, sats, and the discount badge to a single source of truth. Applying a code rewrites all three from the response; clearing re-fetches the base 5% quote. The badge can no longer say "5% OFF" while the price reflects a stacked promo.
  • proceedWithLightning() warns if the invoice's amountSats differs from the previewed sats.

Priority 2 — mobile overflow (320 / 375 / 414px)

  • .checkout-card: box-sizing: border-box + width/max-width: 100% so padding and the border-image gradient can't bleed past the screen edge.
  • .promo-input: min-width: 0 so the flex input can shrink.
  • .promo-apply: flex-shrink: 0 so the Apply button keeps its size and stays on-screen.
  • .payment-provider: drop the indent at ≤480px so the sats amount stays on one line.
  • .discount-badge: moved inline with the price (inside .usd-pricing, flex-wrap), dropped margin-left: auto.
  • Reduced .checkout-page / .checkout-card padding at ≤480px.

Stripe path and server-side promo validation untouched.

Verification

  • pnpm test151/151 pass.
  • pnpm check — the 4 changed files (3 checkout pages + apply-promo) introduce 0 errors. There are 9 pre-existing svelte-check errors on main, all in the Branta SDK v3 files (brantaService.server.ts / api/branta/register) — unrelated to this change and fixed separately in fix(branta): align brantaService with Branta SDK v3 types #410.

🤖 Generated with Claude Code

…verflow

Priority 1 — price/badge correctness:
- /api/membership/apply-promo now stacks the 5% BTC discount on the
  promo-adjusted price and converts to sats with the SAME pipeline as
  create-lightning-invoice. It returns discountedUsd, amountSats, btcPrice,
  and totalDiscountPercent (combined promo + BTC discount off list).
- Cook+, Pro Kitchen, Genesis checkout cards now bind USD, sats, AND the
  discount badge to a single source of truth (discountedUsdAmount / amountSats
  / discountPercent). Applying a code rewrites all three from the apply-promo
  response; clearing re-fetches the base 5% quote. The badge can no longer say
  "5% OFF" while the price reflects a stacked promo.
- proceedWithLightning() console.warns if the invoice's amountSats differs
  from the previewed sats (e.g. BTC spot drift between preview and invoice).

Priority 2 — mobile overflow (320/375/414px):
- .checkout-card: box-sizing: border-box + width/max-width 100% so padding and
  border-image count toward width and never push past the screen edge.
- .promo-input: min-width: 0 so the flex input can shrink below its placeholder.
- .promo-apply: flex-shrink: 0 so the Apply button keeps size and stays on-screen.
- .payment-provider: drop the 2.25rem indent at <=480px so the sats amount
  stays on one line.
- .discount-badge: moved next to the price (inside .usd-pricing, flex-wrap)
  and dropped margin-left:auto so it no longer floats onto its own line.
- Reduce .checkout-page / .checkout-card padding at <=480px.

Stripe path and server-side promo validation untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying frontend with  Cloudflare Pages  Cloudflare Pages

Latest commit: e7faf57
Status: ✅  Deploy successful!
Preview URL: https://6c80a5ee.frontend-hvd.pages.dev
Branch Preview URL: https://fix-membership-checkout-mobi.frontend-hvd.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
zapcooking-frontend e7faf57 Jun 01 2026, 08:29 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jun 1, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
frontend e7faf57 Jun 01 2026, 08:32 PM

@spe1020 spe1020 merged commit c8b9ef4 into main Jun 1, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant