Our shop sells handmade crochet — blankets and tops, made to order. When the owner finishes a piece, she taps "done with product" on that order in her dashboard. That tap is supposed to trigger the whole finish line on its own: a ready notice to the customer, then the balance invoice at the exact catalog price. No re-typing the amount, no second tap, no invoice sent from memory.
On December 3, the owner asked for exactly that: make the Done button trigger the flow from there, and send her the invoice email to review first.
The wiring, and the first deploy that never happened
The wiring was built and verified the same day. A Done tap sends the ready notice once, ever, then fires the invoice path. A blanket or a top invoices at its exact catalog price. A custom order never gets an invented amount — it gets a price follow-up task for the owner instead, and waits. The server endpoint went live that afternoon with the rest of the release, and the gate was proven the honest way: a call with the wrong password came back 401, so the endpoint is registered and locked. The invoice email preview went to the owner only — a sample blanket at $120 total, $20 deposit, $100 balance — for her review.
The deploy for the dashboard half didn't go out on its own. Two auto-deploys canceled themselves with "no changes detected in base directory." The changed files sit outside the site's base directory, so the host's change detection skipped the build entirely — twice. A manual clear-cache deploy at 4:42 PM finally published it: 135 functions, and the live dashboard file byte-matched the new one when we checked from our own machine. The wiring was live.
The tap-test: the stage saved, the invoice didn't show
The owner authorized a live tap-test: "Tap through it then and report." We placed a test order — a baby blanket, blush and cream, budget $100–$150 — and tapped Done on that order only. No live order was touched, and no email went to a real customer.
The stage saved to Done and stayed saved after navigating away and back. But no invoice was visible. The first report blamed the obvious suspect: the order had no accepted total yet, so the invoice was waiting as a draft.
That was wrong, and we corrected it the same evening. The invoice isn't gated on an accepted total at all — it's gated on the item type matching the catalog. And re-tapping Done to check again would prove nothing anyway: the trigger fires only on the first Done tap per order. The ready notice was probably sent too — the first report checked the Sent Emails log, which that email path never writes to. Wrong log, not a missing email.
The catalog test that couldn't run
The owner then authorized a fresh catalog test to prove the $120 total / $20 deposit / $100 balance flow end to end. It was blocked — not by a bug, but by an absence. There is no catalog purchase path anywhere in the shop. There is no shop page: the shop URL redirects to the homepage. The chat is quote-first and won't sell a fixed-price blanket. The dashboard's manual order form has no price field and no catalog selector. A real customer has no way to buy a blanket at a fixed price today, either.
The surprise: the invoice showed up late — at the wrong amount
Then the first test order changed. Hours after the Done tap, it showed a balance invoice in Payments — displayed as $100 total, $80 balance due. Not the $120 total we expected, and not immediately after the tap. Amount wrong, timing wrong.
The resolution came from reading the invoice itself instead of the dashboard. The Stripe invoice was correct all along. $100 is the balance on a $120 blanket: $120 total, less the $20 deposit. The Done tap had fired the invoice. The money part of the flow was proven.
The bug was the display. When the invoice was created, the code overwrote the order's final_total with the $100 balance amount — and then the dashboard subtracted the $20 deposit a second time. $100 total, $80 balance due. The real balance due is $100.
One more finding from the same investigation: every blanket order matches the catalog by keyword, so all blanket orders invoice at $120 on Done. There is no separate custom-blanket price in the wiring. That is why a custom design request invoiced at the catalog price at all — the test order was effectively a catalog blanket.
The fix: one line
In the invoice function, the balance patch sets the order's total to the charge — the balance — instead of the full order total. The full total was already computed in the same file, one line above. The fix is exactly that:
final_total: orderTotal, // was: final_total: charge Eleven tests pass on the fixed code, including one that reproduces the exact wrong display — $100 total, $80 due — from the old line, and one that checks the dashboard math now matches Stripe. The deposit branch is untouched, and the no-deposit and discount cases still behave as before.
The deploy took the same detour as the wiring. The fix was authorized at 5:38 PM and pushed to main in a single batched push, one line changed. The auto-deploy canceled at 5:56 PM on the same base-directory gotcha. A manual clear-cache deploy at 6:35 PM finally published it — 135 functions, the invoice function re-bundled at 6:35 PM, the fix live. The saved hosting login was rejected twice along the way, so the owner signed in himself to trigger the deploy.
What is not done yet
The fix corrects future invoices only. The test order's stored total doesn't change on its own, so its dashboard display still reads $100 total / $80 balance due until that row is corrected or the order is deleted. Live proof of the fix still needs a fresh test order and one Done tap.
And the shop still has no catalog purchase path. The invoice flow now works end to end, but a customer can't start it from a fixed-price buy — that needs a defined catalog route, a shop page or a way to mark an order as catalog, before the flow is something a real buyer can actually use.
