Take the donation here, on FlameNet's own account #3

Merged
paulhitt merged 1 commits from feat/donate-connected-account into main 2026-08-25 19:00:18 +00:00
paulhitt commented 2026-08-25 18:56:36 +00:00 (Migrated from gitlab.com)

Donations on files.flamenet.io were being charged to the Extant 2000 platform account, not to FlameNet. A Stripe call that names no connected account is answered against the platform itself — with a 200, a receipt and a real charge — so the page looked correct and the only symptom was which balance the money turned up in.

What changes

  • FN_DONATE_ACCOUNT is sent as Stripe-Account on the Checkout Session call. The charge becomes a direct charge on FlameNet (acct_1Txvmy…): its balance, its fees, its payout, FLAMENET on the statement. Leaving it blank still means "charge whatever account this key belongs to" — the right answer for a self-hoster — and boot now logs which of the two it is doing.
  • FN_DONATE_PUBLISHABLE_KEY is the platform's pk_, not the connected account's: a direct charge is confirmed by the platform key scoped with stripeAccount, and the account's own key is the wrong half of that pair.
  • The payment form opens on the page (ui_mode=embedded_page + initEmbeddedCheckout) instead of handing the donor to checkout.stripe.com and bouncing them back. Card fields are still Stripe's own frame, so this stays out of PCI scope.
  • Environment.value — blank means absent. Compose sets every VAR: ${VAR:-} to "" and Environment.get returns that, so != nil read an unconfigured deployment as a configured one. The refusals are now specific: a missing publishable key, mismatched key modes, or an FN_DONATE_ACCOUNT that isn't an account id each name themselves rather than rendering a form that cannot work.

⚠️ ui_mode=embedded is dead

The current API version rejects it: "The ui_mode value embedded is no longer supported. Use embedded_page instead." Nothing pins a Stripe-Version, so the account default decides — this arrived as a 400 on a live donate page, not as a build failure. Worth knowing before anything else here is written against a documented value.

Verified in production

Deployed to files.flamenet.io before this MR was opened, and checked rather than assumed:

  • a live session created through the page is No such checkout.session under the platform key alone, and resolves with Stripe-Account: acct_1Txvmy… — ui_mode=embedded_page, livemode=true;
  • in a real browser the Stripe frame mounts in the page, the URL never leaves /donate, and the console is clean;
  • boot logs donations are taken on connected account acct_1Txvmy….

No card was entered, so the last inch — a completed charge landing in the FlameNet balance — is untested.

Notes for review

  • Prod currently runs an image built from a worktree at e04b5a7 plus these changes, not from main; /srv/prod/files/README-donate.md on the box says so. Merging and redeploying from main is what makes that temporary state go away.
  • The unshipped storage paragraph in your working copy of donate.leaf is deliberately not included — this MR is only the payment flow.

🤖 Generated with Claude Code

Donations on **files.flamenet.io** were being charged to the **Extant 2000 platform account**, not to FlameNet. A Stripe call that names no connected account is answered against the platform itself — with a 200, a receipt and a real charge — so the page looked correct and the only symptom was which balance the money turned up in. ### What changes - **`FN_DONATE_ACCOUNT`** is sent as `Stripe-Account` on the Checkout Session call. The charge becomes a **direct charge on FlameNet** (`acct_1Txvmy…`): its balance, its fees, its payout, `FLAMENET` on the statement. Leaving it blank still means "charge whatever account this key belongs to" — the right answer for a self-hoster — and boot now logs which of the two it is doing. - **`FN_DONATE_PUBLISHABLE_KEY`** is the **platform's** `pk_`, not the connected account's: a direct charge is confirmed by the platform key scoped with `stripeAccount`, and the account's own key is the wrong half of that pair. - **The payment form opens on the page** (`ui_mode=embedded_page` + `initEmbeddedCheckout`) instead of handing the donor to `checkout.stripe.com` and bouncing them back. Card fields are still Stripe's own frame, so this stays out of PCI scope. - **`Environment.value`** — blank means absent. Compose sets every `VAR: ${VAR:-}` to `""` and `Environment.get` returns that, so `!= nil` read an unconfigured deployment as a configured one. The refusals are now specific: a missing publishable key, mismatched key modes, or an `FN_DONATE_ACCOUNT` that isn't an account id each name themselves rather than rendering a form that cannot work. ### ⚠️ `ui_mode=embedded` is dead The current API version rejects it: *"The ui_mode value `embedded` is no longer supported. Use `embedded_page` instead."* Nothing pins a `Stripe-Version`, so the account default decides — this arrived as a **400 on a live donate page**, not as a build failure. Worth knowing before anything else here is written against a documented value. ### Verified in production Deployed to `files.flamenet.io` before this MR was opened, and checked rather than assumed: - a live session created through the page is **`No such checkout.session`** under the platform key alone, and resolves with `Stripe-Account: acct_1Txvmy…` — `ui_mode=embedded_page`, `livemode=true`; - in a real browser the Stripe frame mounts in the page, the URL never leaves `/donate`, and the console is clean; - boot logs `donations are taken on connected account acct_1Txvmy…`. No card was entered, so the last inch — a completed charge landing in the FlameNet balance — is untested. ### Notes for review - Prod currently runs an image built from a worktree at `e04b5a7` plus these changes, **not** from `main`; `/srv/prod/files/README-donate.md` on the box says so. Merging and redeploying from `main` is what makes that temporary state go away. - The unshipped storage paragraph in your working copy of `donate.leaf` is deliberately **not** included — this MR is only the payment flow. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
paulhitt commented 2026-08-25 19:00:19 +00:00 (Migrated from gitlab.com)

mentioned in commit aa45b9fb82

mentioned in commit aa45b9fb8251a99c31d8b7857f5f548e5150e2ca
paulhitt (Migrated from gitlab.com) merged commit aa45b9fb82 into main 2026-08-25 19:00:19 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No labels
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: extant2000/flamenet-files#3