Skip to content

Taking payments in your App ​

What App payments do ​

An App you publish can charge its own users — for a one-time purchase or a subscription — and the money goes to you. This is for selling things through your App: a clothing store checkout, event tickets, a paid membership, collecting dues. MotherFluxer is the tool that builds and hosts the App; it is not the seller and does not hold your money.

You set this up in the App editor's Manage › Payments. It holds two containers: Account, which says whether your App can take money, and Prices, which lists what it sells. Payments is the owner's alone — a collaborator doesn't see it.

The charge happens on your Live App, so Payments works on a published App: until you publish once, Prices is empty and every control opens Publish first.

Payments belong to your own App. A copy of your App posted to Slop, and a co-op's App, take no payments — neither has an account to be paid into, so each runs with payments off whatever your App is set to.

Choose how your App gets paid ​

Under Manage › Payments, press Settings on Account. Charges is one of three:

  • Off — your App takes no money.
  • MotherFluxer — you connect a Stripe account through MotherFluxer's guided setup, with no keys to paste. Your App charges on that connected account, and the Fee line shows MotherFluxer's platform fee.
  • Own Stripe — you paste your own Stripe keys. Your App charges on your own Stripe account, the money goes straight to you, and the Fee is 0%. Choose this if you already have a Stripe account.

Press Save. The Account container then shows Connected once your App can charge, Verifying while Stripe checks your details, Onboarding incomplete while Stripe still needs something from you, Not connected before you connect, or Off. You can switch at any time.

Get paid through MotherFluxer ​

  1. In Account → Settings, set Charges to MotherFluxer.
  2. Beside Stripe, press Connect. A Stripe window opens for you to sign in or create a Stripe account and finish Stripe's verification. If your browser blocks the window, the Account window says Popup blocked.
  3. When you finish, the window says where your account stands, and Stripe shows your status.

Stripe usually takes a few minutes to check your details after you finish. Meanwhile Stripe shows Verifying, and there is nothing more to do: the status changes to Charges enabled on its own when Stripe is done, without reopening anything. Your App can charge once it shows Charges enabled. If it shows Onboarding incomplete, Stripe still needs something from you — press Finish to pick up where you left off. Otherwise Manage opens your Stripe account.

Get paid on your own Stripe ​

  1. In Account → Settings, set Charges to Own Stripe.
  2. Paste your Secret key (it starts with sk_live_ or sk_test_).
  3. In your Stripe account, add a webhook endpoint for your App: copy the address the window shows beside Webhook, and choose the events it lists beside Events. Until your App is first published, Webhook says After the first publish — it has no address yet.
  4. Paste that endpoint's Signing secret (it starts with whsec_). Until it is set, the window says it is Needed to confirm — your App needs it to confirm a payment before it grants anyone anything.
  5. Press Save.

Your keys are Encrypted and Never shown again. Each shows Set once stored; to replace one, paste a new one and save again. They are kept in your MotherFluxer account's vault, Settings › Account › Connections & Keys, which lists each one with the App that reads it — never its value.

What your App sells is a group ​

A group is a kind of person your App has — Free, Pro, Staff. A group with no price is one you hand out yourself; a group with a price is one people buy, and buying it is what puts them in it.

Because a group is a kind of person, you create and edit it in Manage › Users, not in Payments: its name, its ID, what it Includes (one line each) and its Limits (named allowances such as projects or storage, each a number or No limit). Limits are Reported only — your App reads them back and decides what to do — and someone in two groups gets the larger allowance (Most generous wins).

Prices in Manage › Payments lists every group that can be sold, each with its prices. A group without one shows No price · Hand-out. Your default group — the one everyone starts in — is never listed: Default cannot be sold, because everybody already has it.

Put a price on a group ​

Every price is edited in one price window. Open it from Manage › Payments → Prices — press New price on a group, or a price's pencil — or from a page's window in Manage › Pages, with the pencil beside a group.

  • Group — which group this price sells (a new price only; an existing price stays in its group).
  • Label — what the buyer sees for this price, such as "Monthly".
  • ID — the name your App's code uses for this price. It can't change once the price exists.
  • Amount — how much.
  • Every — Month, Year or Once.
  • Free days — an optional trial on a recurring price; the buyer is not charged until it ends. A price charged Once has No free days.
  • Currency — set by a group's first price and shared by every price on it (One for the group). To change it later, edit the currency box beside the group's name in Prices.

A group can carry several prices, so you can offer the same group monthly and yearly. Press Save.

When Live's checkout meets a price ​

Your Draft and your Live App each sell their own prices. Saving a price puts it on sale in your Draft as soon as your Draft updates with it, so you can try the checkout in the editor's preview. Your Live App keeps charging what it was published with until you publish again — the price window says so under Live checkout: On publish.

This holds for every change: a new price, a changed amount, new free days or a deleted price. Nothing you save reaches your Live App's customers before you publish it.

If Stripe doesn't take a price, the price stays saved, and your Draft offers it to Stripe again the next time it updates. Send to Stripe, in Prices, sends it straight away and says why if Stripe still refuses it. If Stripe didn't take your Live App's prices when you published, the publish still goes through and says Live’s prices not on sale · send them from Payments.

Getting your prices onto Stripe ​

Prices shows how many prices your App has, or Nothing to send. Press Send to Stripe to send every priced group again — for example after you finish connecting an account. It sends your Draft's prices and your Live App's own prices, each as it stands, so it never puts a price on Live that you have not published. It then says what happened: Sent to Stripe, or what is missing — Not sent · choose how you get paid, Not sent · add your Stripe key, Not sent · finish Stripe setup — or Stripe's own reason if it refused. A group you price before your setup is finished is saved either way; it simply is not on sale until the setup is done.

Deleting a price asks first, and says your Live App keeps selling it until you publish (Live · On publish). If it is the group's last price, the group becomes a hand-out group (Group becomes hand-out).

Check what somebody has bought ​

Your App asks which groups the current visitor is in and shows them the right thing — hiding a paid feature, showing an upgrade prompt, enforcing a limit.

In your App's pages, window.mfAccess.current() answers with the groups the visitor is in, everything those groups include, and their merged limits. window.mfAccess.groups() answers with the groups your App offers, so a pricing page can render from your real configuration instead of copy you typed twice. In an action — your App's server code — ctx.access.get() answers the same question where the visitor cannot forge it — use that one to gate anything that actually costs something.

You do not have to record purchases yourself. When somebody buys, they are put in the group; when they cancel a subscription, they come out of it at the end of the period they paid for. A price charged Once keeps them in the group for good, and it stands on its own: cancelling a subscription to the same group does not take it away. A group you handed out by hand is untouched by any of that. Payment notices that arrive late or out of order never undo a newer one, so what somebody holds always follows their latest payment.

Taking somebody out of a group takes effect on their very next page load, so a cancellation or a revoked group is never waiting on a session to expire.

How your App uses payments in code ​

Account → Code shows the two calls a payment runs on, ready to copy: Charge, which starts a checkout for one of your prices, and Confirm, which checks the payment Stripe reports before granting anything. Both run in an action — Runs in an action: on your App's server, never in a visitor's browser — and the same code works whichever way you get paid:

  • ctx.payments.createCheckout({ groupId, priceId, … }) starts a checkout for one of your priced groups and returns a URL to send the buyer to. The price, free days and currency come from the group, and the purchase is stamped so the buyer lands in that group when the payment confirms. To charge for something that is not a group — a product in a store, a ticket, a one-off amount — spell out the line items instead.
  • ctx.payments.createPortal({ … }) gives a subscriber a page where they can manage or cancel what they bought.
  • ctx.payments.verifyWebhook({ … }) confirms an incoming payment notification in a webhook action, so you only grant access after a real, verified payment.

Your App's page sends the buyer to that checkout by calling window.mfFn.open with the action's name — it runs the action and goes to the page it returns. A page can only do this once you have opened the action under Who can run it. Stripe's checkout will not run inside another page, so when your App is shown inside one — the editor's preview, the community, or someone else's site — checkout opens in its own window and your App stays where it is. In its own tab, your App goes straight to checkout.

You never handle raw keys in your App code — the setup you saved in Account is used securely on the server.

Switching or turning off payments ​

Open Account → Settings any time to switch between MotherFluxer and Own Stripe, or to replace your keys or reconnect. Your App keeps using whichever is chosen. Set Charges to Off and your App stops taking new payments.

Your groups are unaffected by any of this — they live in Manage › Users, not in Payments. A group with a price simply stops being buyable until payments are set up again, and everyone already in a group stays in it.