Toolaby

Move from ExtensionPay

Keep your ExtPay code as it is. One command switches it to Toolaby and copies your plans; your subscribers move with their cards.

An extension that sells with ExtensionPay moves to Toolaby without its payment code being rewritten. ExtPay('…') keeps its methods and the shapes they answer with, and Toolaby answers them.

How the two compare, fee by fee: Toolaby vs ExtensionPay.

Switch the extension

In the extension's folder, with the tool made on the dashboard:

npx -y toolaby@latest wire <tool-id> --from-extensionpay

wire moves ExtensionPay only when asked by name. Without --from-extensionpay, it stops when it finds ExtensionPay, says where, and writes nothing. The Wire button on the Set up page does not move it: it gives this command.

wire finds ExtensionPay the way it came into the project, and switches each one:

The extension haswire
import ExtPay from 'extpay', or require('extpay')Points the line at toolaby.js: import { ExtPay } from './toolaby.js'
ExtensionPay's own ExtPay.js, under a name containing extpay or extensionpay, loaded by importScripts() and <script>Puts Toolaby's in its place. The importScripts('ExtPay.js') and <script> tags stay as they are
ExtPay.module.js or ExtPay.common.jsReplaces it with one line that hands on Toolaby's
ExtensionPay built into a bundle, such as dist/background.jsChanges nothing in it, and names it: switch the source it is built from, then build again
ExtensionPay's content script on extensionpay.comTakes it out of manifest.json, with its host permission. In a WXT, CRXJS or Plasmo project, whose build makes the manifest, it says to take it out of your manifest settings
A content security policy whose connect-src leaves Toolaby's address outAdds Toolaby's address, which every call of Toolaby's needs

wire adds no host permission, as for any extension: Toolaby needs the storage permission ExtensionPay already asked for, and its address under externally_connectable, which Chrome shows no one. So the switched extension's update asks your users nothing new, and Chrome does not switch it off. Where ExtensionPay's content script was there for onPaid, the permission warning it brought goes with it.

The rest of the code stays as it is. A use wire cannot be sure of, such as import * as ep from 'extpay', is listed to change by hand. Remove the package with npm uninstall extpay when you like.

Wired again later, with upgrade or wire, an extension that has moved needs no flag: Toolaby's ExtPay.js is brought up to date with the other Toolaby files.

wire also puts Toolaby's background in front of yours, as it does for any extension, and asks which paywall people meet first:

  • Toolaby's (recommended): the Toolaby popup in front of yours. It shows Toolaby's sign-in and plans when your dashboard says someone can't use the extension yet (nothing free, or an account asked for), and opens your popup once they can. An open is never counted: your ExtPay calls say what is paid.
  • Yours, as it was with ExtensionPay: your popup in front, and openPaymentPage() opens Toolaby's paywall.

Your code is not deleted either way. Without a terminal, as when an agent runs it, add --toolaby-popup or --own-popup; without one, wire stops and writes nothing. upgrade --toolaby-popup or --own-popup changes it later. See Command line.

Plans

wire reads the plans from ExtensionPay's public list for the extension, the one its getPlans() reads, and makes each on the tool, on Test. The extension is the one the first ExtPay('…') in your code names, with its id written out: an id held in a variable copies no plans. Each keeps its ExtensionPay nickname as its tier, which is what openPaymentPage('pro') finds it by. Rename a tier and change that call with it.

ExtensionPay planOn Toolaby
onceA lifetime plan
month or year, every 1A subscription, monthly or yearly
Billed every 3 months, or any count above 1Not made: Toolaby bills monthly or yearly. wire lists it

A plan the tool already has by that name is left as it is. On Live, wire makes none: copy them from Test with Set up → Copy to Live. See Pricing.

Buyers

ExtensionPay keeps paying customers in your own Stripe account, the one it charged on. Its dashboard has no export; ExtensionPay asks to be emailed for one.

  1. Subscribers. Copy your customers from that account to the one under Configure → Payments, in Stripe, then move their subscriptions on the tool's Import page. Each keeps their price, renewal day and card, and nobody is charged twice. Do this before you publish the switched extension. See Move subscriptions from another Stripe account.
  2. One-time buyers. Export the payments from your Stripe Dashboard as CSV, and keep one row per buyer's address. Rename the address column to email; other columns are ignored. Leave out failed and refunded payments. Import them on the tool's Import page as licences: up to 100 on Hobby, all of them on Pro. See Migrate existing customers.
  3. Each buyer signs in with the address they paid with, by Google or by an email link, and the extension unlocks. On another computer they sign in there too, as they did with ExtensionPay.

Keep ExtensionPay connected to your Stripe account until every user has the switched extension, and until the last old subscription has ended: the Import page says when. Disconnecting it is permanent.

The calls, under Toolaby

ExtPayToolaby answers
startBackground()Starts Toolaby's background, once. wire already does
getUser()ExtensionPay's User: paid, paidAt, email, installedAt, plan, subscriptionStatus and subscriptionCancelAt, from the User Toolaby keeps. When the device holds no token from the last 15 minutes, it asks Toolaby first, as ExtensionPay's asks its server. It waits up to 3 seconds, then answers what the device holds. Once asked, Toolaby is asked again after five minutes on Live and ten seconds on Test, whether it said unpaid or did not answer. A purchase, a sign-in, or a visit to the checkout or account page is asked about at once
getPlans()ExtensionPay's Plan for each plan the tool sells. The nickname is the plan's id
openPaymentPage(nickname)The tool's checkout page, the plan chosen: by id, then by tier, then by name
openLoginPage()Toolaby's sign-in
openTrialPage()The tool's checkout page. A subscription plan with a free trial starts it there, at Stripe Checkout, which takes the card and charges it when the trial ends
onPaidWhen the user becomes paid: a purchase, a trial that starts, or a sign-in that brought one. Also when it happened while the background was stopped, and when Toolaby's answer comes after getUser() answered unpaid
onTrialStartedWhen a trial started without a card from your website begins, the same way. A trial taken at checkout fires onPaid

A trial taken at checkout, which openTrialPage() leads to, is the plan's own, run on Stripe. It is a subscription in its trial: paid is true while it lasts, subscriptionStatus is active, onPaid fires when it starts, and trialStartedAt stays null.

trialStartedAt and onTrialStarted follow a trial started without a card from your website, with Toolaby.startTrial() (Website JavaScript). trialStartedAt is set so that ExtensionPay's usual check, now - user.trialStartedAt < 7 days, answers as that trial does: now while the trial runs, a year before it ended once it has.

The trial, the subscription and the plan follow paid, which comes from the token Toolaby signed. While paid is false, trialStartedAt never reads as a trial that runs, subscriptionStatus is never active, and plan and paidAt are null. plan.nickname is the plan the token was signed for, and null when the token names none, as for a licence imported without a plan.

The price and period are that plan's own: from the description Toolaby sends beside the token when it describes the same plan, otherwise from the tool's plans, as getPlans() reads them. When those cannot be read, the price is 0 and the period once, never another plan's. A device that cannot reach Toolaby keeps its last token for 24 hours, then reads as unpaid (How it works).

ExtPay('…') takes your ExtensionPay id and ignores it: the tool is the one toolaby.config.js names. In TypeScript, ExtPay and its types come from toolaby.d.ts.

On this page