Skip to content

No email to buy, coupons in the app, 2 free exports - #97

Merged
mehfuzh merged 10 commits into
mainfrom
auto-activate-checkout
Nov 10, 2026
Merged

mehfuzh merged 10 commits into
mainfrom
auto-activate-checkout

Conversation

@mehfuzh

@mehfuzh mehfuzh commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Upgrading to Pro no longer asks for an email.

  • The app saves a one-time secret and sends only its hash (plus the device id) with the checkout. Stripe asks for the email itself.
  • Once the checkout is paid, stripe-webhook records the claim in checkout_claims. The app quietly polls the new license-claim function, which activates this computer with no code to type.
  • If the email used at checkout already had a license, the app asks for the emailed code instead, so paying with someone else's email cannot take over their account.
  • A Have a coupon code? field on the upgrade card. The code is checked against Stripe promotion codes before checkout opens. With no code typed, Stripe's own code box still shows on the checkout page.
  • The check for the payment runs in the background with no waiting message. It stops on its own after 30 minutes, or as soon as the user signs in.

Backend is already live: the migration is pushed, and license-claim, stripe-webhook and create-checkout are deployed. create-checkout still accepts requests from released app builds.

Not tested yet: a full paid checkout end to end.

2 free exports

  • Without a license, Export asks the new export-allowance function how many of the 2 free exports this computer has left (counted by device ID, so reinstalling doesn't reset them). Export is enabled while some remain.
  • A finished free export is counted. A cancelled or failed one isn't. If the server can't be told, the count waits on disk until the next check.
  • Offline, the free-export Export button is disabled with "Free exports need an internet connection". Licensed export still works offline.
  • This is a new endpoint so builds up to 0.1.39, which ask free-export, don't get their old 3 back.
  • Before merging: deploy export-allowance. At release: update the site copy that says export needs a license (download, comparison, index; en + es).

Upgrading no longer asks for an email. The app keeps a one-time secret and
sends only its hash with the checkout; once paid, stripe-webhook records the
claim and the new license-claim function activates that computer, no code.
An address that already had a license still confirms with the emailed code,
so paying with someone else's email cannot take over their account.

The upgrade card also takes a coupon, checked against Stripe promotion codes
before checkout opens.
Pro and Creator open checkout straight away and the dialog checks silently for
the payment, as the agent panel does. The email and code form moves behind
"Already bought? Sign in". When both watch the same checkout, the second to
ask finds it claimed and takes the key already saved.
Email: sends the code. Code: signs in. Coupon: opens Pro's checkout with it.
In the agent panel and in Export.
Without a license the export dialog asks export-allowance how many of the 2
free exports this computer has left and enables Export while some remain. A
finished free export is counted (kept on disk until the server can be told);
a cancelled or failed one is not. Offline there is no free export, so turning
the network off does not unlock export; a license keeps working offline.

A new endpoint, so builds up to 0.1.39 (which ask free-export) do not get
their old three back.
@mehfuzh mehfuzh changed the title Pro turns on by itself after checkout, coupon code in the app No email to buy, coupons in the app, 2 free exports Nov 10, 2026
No Remove the limit step: while free exports remain the dialog shows the same
upgrade buttons, coupon and sign-in as when they are used up.
The license section (upgrade buttons, coupon, sign-in) made the dialog taller
than a short window, pushing Export to file off screen. The settings now
scroll within the window's height and the Export row stays below them.
The free exports were forgotten on close and asked again on open, so the
dialog appeared short (Checking…) and grew a moment later. They are now asked
when the editor opens, refreshed on each open while the last answer stays on
screen, and the checking state has the same layout as the answer.
A finished free export is recorded and the server's answer replaces the
dialog's count; a cancelled or failed one asks again, giving back the export
taken off when it started. Checks and records run one at a time, so an unsent
export reopening the dialog sends is never counted twice.
@mehfuzh
mehfuzh merged commit 8e60d6c into main Nov 10, 2026
3 checks passed
@mehfuzh
mehfuzh deleted the auto-activate-checkout branch November 10, 2026 04:16
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