Connect Stripe
Where your Stripe keys live, why MaShop never sees a payment, and what to check the day checkout answers 501.
Connect
Stripe takes card payments. In MaShop, Stripe is the default payment provider of the code you own, not an account you authorize in the workspace.
What MaShop can do with Stripe
- Writes the checkout of your public site against Stripe. The generated site carries a checkout route that opens a Stripe Checkout session. A webhook route then fulfils the order, decrements stock and sends the confirmation email.
- Re derives every price on the server, from your own database. The browser sends only a product and a quantity, never a price.
- Generates a Payments screen in your back office, where provider credentials are stored encrypted in your own database.
The catalogue also declares four agent tools: customers.search, checkout.create, invoices.draft and refunds.create. None has an executor yet. An agent that calls one is refused, and nothing is attempted.
MaShop never sits in your money path. It cannot see a payment, and it cannot take a cut of one.
What it touches
- Your Stripe keys, held in the environment of your own site.
- The checkout of your public site, and the return address after payment.
- Your orders and your stock, in your own database, through the webhook.
Default permissions
| Tool | Level | Default state |
|---|---|---|
| customers.search | Read only | Allow |
| checkout.create | Write and edit | Ask |
| invoices.draft | Write and edit | Ask |
| refunds.create | Critical action | Ask |
Connect it
There is no Stripe screen in the workspace. The keys go on the host of your public site, which is the Netlify site MaShop created for you.
- Create your keys in your Stripe dashboard, and your webhook endpoint pointing at your site.
- Open your public site on Netlify, then its environment variables.
- Add the variables below, and the currency if it is not US dollars.
- Redeploy, from the Publish button in the workspace or from Netlify, so the build picks them up.
STRIPE_SECRET_KEY=
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=
STRIPE_WEBHOOK_SECRET=
NEXT_PUBLIC_CURRENCY=usd
NEXT_PUBLIC_SITE_URL=
That block matches the example file shipped in your project. Two of those keys are read by the generated code: the checkout route reads the secret key, and the webhook route reads the webhook secret. The publishable key is listed for a browser side integration the generated code does not use today.
MaShop pushes the database variables to your sites at every deploy. It does not push payment keys, and it never stores them.
Never paste a secret key into the chat
The chat is stored with your conversation. A secret key that leaks cannot be unleaked: it has to be rolled in Stripe, and every deployment using it updated. Set keys on your host, never in a message.
Check that it works
- Place a test order on your published site with a Stripe test card, and follow it to the confirmation.
- Check that the order appears in your back office, with the stock decremented.
- Without the secret key, the checkout route answers 501 with: Checkout not configured. Set STRIPE_SECRET_KEY to enable Stripe checkout.
Limits
- Stripe is the default of the generated code, not a requirement. The code is yours, and the assistant can rewrite it for another provider.
- The keys live on your host. MaShop holds none of them and cannot read them back for you.
- Enabling the Stripe card in your back office does not set the environment variable of your public site. The checkout route reads the environment only.
- Nothing checks these keys at build time. Both routes read them when a request arrives, so a missing or wrong key shows up at purchase time, never during the build.
- Four catalogue tools, none executable.
refunds.createis classified critical, but the owner only signature rule for money is decided on the verb, and this name matches none of the money verbs.
When it breaks
- Checkout answers 501. The secret key is missing on the site. Add it and redeploy.
- Payments succeed but orders never appear. The webhook secret is missing, or the endpoint is not registered in Stripe against your site address.
- The customer lands on the wrong page after paying. The public site address variable is unset or points elsewhere.
- Amounts are in the wrong currency. The currency variable defaults to US dollars when unset.
Remove the connection
Delete the keys from your site environment and redeploy. Then revoke the key in your Stripe dashboard, which is the step that actually ends the access.
There is nothing to disconnect inside MaShop, because nothing was connected there.
