Repository navigation
Legal pages, discount codes and account credit - #48
Merged
Merged
Conversation
GET /billing/promo checks a code with Paygate; POST /billing/checkout takes an optional code and applies it up front. GET /billing/credits returns the account's Stripe balance, and POST /admin/credit lets an admin grant credit in whole dollars, keyed by a request id so a retry grants once.
/terms, /privacy and /refunds sit in the pricing page's frame and are linked from the footer and sign-up. The account and pricing pages take a discount code (also from ?code=) and show any credit; /app/admin can give credit.
…ts-credits # Conflicts: # api/src/index.ts # docs/404.html # docs/index.html # docs/pricing/index.html # site/src/components/shared/SiteHeader.tsx # site/src/pages/console/AdminPage.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the three pages Stripe needs before live payments (FW-605), discount codes, and account credit.
Legal pages
/terms,/privacyand/refunds, in the pricing page's header and footer, prerendered so GitHub Pages answers 200. Linked from the footer bar and the sign-up page, and in the sitemap.site/src/constants/legal.tsand names ERP.AI MA LLC, Massachusetts law andsupport@floodwall.ai. Needs a legal read before go-live, and the mailbox must exist.Discount codes
GET /billing/promo?code=…checks a code with Paygate and returns what it takes off ("20% off for 3 months").POST /billing/checkouttakes an optionalcodeand applies it up front; without one, Stripe Checkout still shows its own code box./pricing?code=LAUNCH20keeps the code for the tab through sign-up.Credit
POST /admin/credit(admins): give an account credit in whole dollars, up to $10,000. A request id makes a retry grant once. The Paygate customer is created with the account's email first.GET /billing/credits: the account's balance, shown on/account. Stripe spends it on the next invoices./app/adminhas a Give credit form.Paygate (already done, not in this diff)
api.floodwall.ai/billing/webhook, return pages on floodwall.ai. The live keys are in Box; the Worker keeps the test keys until sandbox testing is done.Testing
npm --prefix api run check: 76 pass (5 new).npm --prefix site run check: typecheck, 24 tests and the build pass;docs/is rebuilt.cd api && npm run deploy, no migration needed), then try a sandbox coupon and a credit grant against Paygate test mode.