Do it yourself
#- Create an account at https://stripe.com, or open yours. Stay in test mode while you build.
- In the Stripe Dashboard, copy the test keys: the publishable key (
pk_...) and the secret key (sk_...). - In Playcode, open Settings, choose Secrets and, under Development, add the secret key under the name the agent asks for, like
STRIPE_SECRET_KEY. Turn on Secret. Do not paste a secret key into the chat: the chat keeps it in its history. - Ask the agent for the payment: what you sell, the price, and whether it is a one-time payment or a subscription. It builds Checkout, loads Stripe.js on every page of the site, and creates the payment session on your server only when a buyer clicks.
- In the Stripe Dashboard, add the webhook endpoint the agent gives you, with the events it names, like
checkout.session.completed. Copy the endpoint's signing secret (whsec_...) into Settings, Secrets the same way. - Buy once with Stripe's test card,
4242 4242 4242 4242. The agent checks that the webhook arrived and that the purchase unlocked in your app. - To go live, activate your Stripe account, copy the live keys and add a live webhook endpoint for the published app. Put the live values under Production in Settings, Secrets, then publish.
On a static site
#A static site has no server to keep a secret key. Create a Payment Link in the Stripe Dashboard and ask the agent to add it as the buy button. No keys go into the project.
If it doesn't work
#The buyer paid, but the purchase did not unlock
#Your app unlocks a purchase from Stripe's webhook, never from the page the buyer returns to. Check the endpoint's address and events in the Stripe Dashboard, and that its signing secret is in Settings, Secrets for the right environment. Then ask the agent to read the app's log.
It worked in test mode, but not live
#Live payments use other keys and another webhook endpoint. Check that the live values are under Production, and publish again.
The agent asks for a full-stack project
#Checkout sessions, webhooks and subscriptions need a server for the secret key. Use a Payment Link, or make the project a Cloud app. See Browser and Cloud projects.
Limits
#- Stripe decides whether your account can take payments. Its fees, payouts, tax rules and fraud checks apply; Playcode guarantees none of them.
- Card details go straight to Stripe's page. They never reach your app or Playcode.
- For subscriptions, the agent uses Stripe's own customer portal for cancelling and changing plans, instead of building those pages.
- Selling digital goods inside an iPhone or Android app falls under the app stores' rules, which differ by region. Payments on the website are not affected.
- This page is about payments in your app. Your Playcode plan is billed separately: see Plans.