onSuccess never fires after payment
onSuccess never fires after payment
Playto.checkout() never calls an onSuccess you pass to it. Success is
reported only by Playto.handleReturn(), so call it on the page the
customer returns to — that’s what reads the result from the URL.Also confirm your returnUrl points to a page that actually loads the SDK and
calls handleReturn(), and that nothing on that page removes playto_status
from the URL before handleReturn() runs.The modal opens but the checkout area is blank
The modal opens but the checkout area is blank
Usually a Content-Security-Policy on your site blocking the iframe. Allow
Playto as a frame source:Also check the browser console for the real error and confirm the product id
exists and is active.
“Could not load playto.js”
“Could not load playto.js”
The script URL is wrong or blocked. Use
https://app.playto.so/pay/playto.js. If you have a script-src CSP, allow
https://app.playto.so. For local development against a webapp dev server,
point the script at http://localhost:<port>/pay/playto.js.“Link Not Found” with a sandbox or live id
“Link Not Found” with a sandbox or live id
Sandbox and production are isolated. A sandbox id only works with
env: "sandbox", and a live id only without it. Without env: "sandbox", a
sandbox id shows Link Not Found. Make sure the id and the env match, and
that the product or invoice is still available.“This domain is not approved to use Playto embedded checkout”
“This domain is not approved to use Playto embedded checkout”
This happens in Live only. The site that opened the checkout is not on an
approved domain on your account.
- Add the domain under Playto Pay → API Key → Embedded checkout domains with Live switched on, and wait until it shows Approved.
- An approved domain covers its subdomains, so approving
example.comcoverswww.example.comandshop.example.com. An approved subdomain doesn’t cover its parent:shop.example.comdoesn’t coverexample.com. - Still testing? Pass
env: "sandbox"with a sandbox id. Test mode needs no approval.
“The embedding website could not be identified”
“The embedding website could not be identified”
This happens in Live only. The checkout could not read the origin of the
page that opened it, so it cannot match it to an approved domain.
- Open your page from a real
http(s)address. A page opened from a file on your computer (file://) or inside a sandboxed iframe has no usable origin. - Load playto.js from
https://app.playto.so/pay/playto.js. - Still testing? Pass
env: "sandbox"with a sandbox id. Test mode needs no approval.
“This checkout opens from the merchant's website with playto.js”
“This checkout opens from the merchant's website with playto.js”
The embedded checkout runs only inside the modal that
Playto.checkout()
opens. You will see this message if:- The checkout address (
/pay/checkout?…&embed=1) was opened directly in a browser tab. - playto.js did not answer within about two seconds. Check that it loaded from
https://app.playto.so/pay/playto.jsand is not blocked.
checkout_url instead.“A valid merchant return URL is required for embedded checkout”
“A valid merchant return URL is required for embedded checkout”
This happens in Live only, when the customer starts to pay. The
returnUrl is not an http(s) URL (for example mailto: or javascript:),
or is longer than 1000 characters. Pass an http(s) URL, such as
https://example.com/thanks. A relative URL such as /thanks is fine:
playto.js turns it into a full one.Test mode doesn’t show this error. It ignores such a returnUrl, and the
customer may not be sent back to your page after paying. Fix it before going
live.The customer isn't sent back to my page after paying
The customer isn't sent back to my page after paying
Embedded checkout returns the customer to your
returnUrl. If you don’t pass
one, it uses the page that opened the checkout. It ignores any redirect URL set
on the product or invoice.- Pass a full
returnUrlto send customers somewhere other than the current page. - The page at
returnUrlmust load playto.js and callPlayto.handleReturn()to read the result. - Closing the modal with the close button doesn’t send the customer anywhere.
Only
onClosefires, with the reason"user".
Popup blocked
Popup blocked
The embedded checkout does not rely on popups — the card form is shown
inside the checkout itself, so popup blockers don’t affect card entry. If you
built a custom flow that opens a window, trigger it directly from the user’s
click.
I want to preview it without a real product
I want to preview it without a real product
Pass
demo: true to Playto.checkout(). It renders a sample product and a
simulated gateway — the full flow, no backend, no charge.