Test in sandbox first
Run the whole flow with no real money:- Use a sandbox product / payment-link id.
- Pass
env: "sandbox"toPlayto.checkout. - Complete payment with the test card in the checkout’s card form.
- Confirm your
onSuccess(viahandleReturn) fires and the transaction shows up in your dashboard.
Test mode needs no domain approval. Any domain works, including
localhost and
ngrok URLs.Approve your domains
In Live, the embedded checkout opens only on domains Playto has approved for your account.- In the dashboard, open Playto Pay → API Key and switch to Live.
- Under Embedded checkout domains, add each site you embed from. Enter only
the domain, such as
example.com. Don’t add a page path or a wildcard. - Wait for Playto to approve it. The domain shows Approved when it is ready. If it stays Pending, contact support@playto.so.
- An approved domain also covers its subdomains. Approving
example.comlets the checkout open onwww.example.com,shop.example.comand any other subdomain. - An approved
www.example.comalso coversexample.com, but not other subdomains such asshop.example.com. - An approved subdomain doesn’t cover its parent: approving
shop.example.comdoesn’t coverexample.com. - The port and the scheme (
httporhttps) are ignored. - Only the page that opens the checkout is checked. Your
returnUrlcan be on any host, as long as it’s anhttp(s)URL. - Shared domains such as
vercel.app,github.ioornetlify.appcan’t be added. Add your own site on them instead, such asyourname.vercel.app.
Go to production
When you’re ready:1
Use a live id
Swap in a real
productId / paymentLinkId from your
live dashboard.2
Drop the sandbox flag
Remove
env: "sandbox" (or set env: "production") and remove demo.3
Get your domains approved
Add the sites you embed from, and your
returnUrl host, under Embedded
checkout domains in Live mode. Wait until they show Approved.4
Serve over HTTPS
Embed only from
https:// pages — gateways and the SDK assume a secure origin.5
Allow Playto in your site's CSP
If your site sets a Content-Security-Policy, allow
https://app.playto.so in
frame-src and script-src. See
Troubleshooting.6
Fulfil from the webhook
Grant access / fulfil orders from the signed webhook, not the browser
callback (next section).
Confirm payments from the webhook, not the callback
onSuccess is great for UX — showing a thank-you, unlocking the next screen.
But the browser callback travels through the customer’s URL bar and can be
spoofed. Do the real fulfilment server-side, off the webhook, which is signed
and authoritative.
- Set your webhook endpoint and copy your signing secret in Configuration → Webhooks in the dashboard (switch to Live: test and live keep separate settings).
- Verify the
X-Playto-Signatureheader (HMAC-SHA256 over the raw body). - Fulfil on
invoice.paid(invoices) orpayment.succeeded(payment links), keyed idempotently off the eventidso retries don’t double-fulfil.
Pre-launch checklist
Using a live id,
env is production, demo removedEvery domain you embed from is approved in Live
Embedding only from HTTPS pages
If your site sets a CSP, it allows
https://app.playto.so for frames and scriptsPlayto.handleReturn() runs on the return pageWebhook endpoint set + signature verified server-side
Fulfilment is idempotent (safe on webhook retries)
Tested a full sandbox payment end to end
