Repository navigation
Take payments through Paygate, and show the plans on the site (FW-607) - #46
Merged
Merged
Conversation
Plans are sold through Paygate (pay.erpai.studio), our Stripe hub, so the Worker never handles a card or a Stripe key. - api: /billing, /billing/checkout, /billing/manage and a signed /billing/webhook. Webhooks are checked (HMAC-SHA256, 5-minute tolerance), deduplicated by event id, and an older event never overwrites a newer plan. payment.failed emails the owner. - api: migration 0003 adds the plan columns (every account starts on Free) and billing_events, swept after a week. - site: pricing moves to a base fee plus overage (Free, Team $49, Business $399); signed-in accounts can buy from /pricing and get a Plan and billing section on /account. - Tests for checkout, the billing page, signatures, replays and out-of-order webhooks, with Paygate stood in. TESTING.md covers local and live testing.
- A Pricing section between Roadmap and Waitlist: the same plan rail as /pricing, Enterprise, and a link to compare every plan. It is prerendered with the rest of the landing page. - The header's Pricing link follows the section while it is in view; the footer lists Pricing. - /pricing drops its noindex tag and joins the sitemap, and the build writes pricing/index.html so GitHub Pages answers it with 200, not 404.
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.
What
Floodwall Cloud can now sell plans. Payments go through Paygate (pay.erpai.studio), our own Stripe hub, so the Worker never handles a card or a Stripe key. The plans are also shown on the landing page, and
/pricingis now public.Plans (base fee + overage)
The extra-decision charge waits for a hosted plane to count decisions (FW-701 / FW-704). Until then, the plans bill their base price.
api/
GET /billing,POST /billing/checkout,POST /billing/manage(Paygate's hosted billing page), andPOST /billing/webhook.payment.failedemails the owner.0003_billing.sql: plan columns onusers(every account starts onfree) andbilling_events, which the daily sweep clears after a week.PAYGATE_URLvar andPAYGATE_SECRET_KEY/PAYGATE_WEBHOOK_SECRETsecrets. Documented inapi/README.md.site/
/pricingshows the new plans. Signed in, it marks your plan and offers Move to Team / Business./accountgets a Plan and billing section: plan, renewal or end date, upgrade, and invoices/card/cancel./pricingdropsnoindexand joins the sitemap. The build writespricing/index.html, so GitHub Pages answers it with 200 instead of 404.TESTING.md
How to test the crate, the Worker and the site locally, run billing end to end through a tunnel, and smoke-test on preview.floodwall.ai.
Testing
api:npm run checkpasses 71 tests, 14 of them new for billing (checkout, billing page, signatures, replays, out-of-order webhooks), with Paygate stood in.site:npm testpasses 24 tests, and the production build works./accountand/pricing, plus the landing section at desktop and phone widths.floodwallapp and its keys don't exist there yet.Before deploying
floodwallwith plansteamandbusiness, the features JSON fromapi/README.md, and webhook URLhttps://api.floodwall.ai/billing/webhook.npx wrangler secret put PAYGATE_SECRET_KEYandnpx wrangler secret put PAYGATE_WEBHOOK_SECRET.api/, runnpm run migrate:remote, thennpm run deploy.