gamexo developers
Leo Cal

Troubleshooting

The widget does not appear, says booking isn't enabled on this website, won't take payment, or a customer paid and nothing was booked.

Open your browser's developer tools (F12) on the page with the widget and keep the Console and Network tabs handy. Most problems announce themselves there.

Nothing appears

The button does nothing, and the console says No key. The script tag has no data-key. Add your browser key:

<script src="https://cal.turfleo.com/v1/embed.js" data-key="gxp_…" async></script>

The button does nothing and there is no message. The script has not loaded. In the Network tab look for embed.js. If it is blocked, a Content-Security-Policy, an ad blocker or a cache plugin is stopping it — see Content-Security-Policy. If you call window.LeoCal.open() from code, use window.LeoCal?.open() so a call made before the script loads does not throw.

The card is an empty box. The element needs data-leo-cal-inline exactly, and a width. A div with no width inside a flex or grid parent can collapse to nothing; give it width: 100% or a pixel width.

It worked on my laptop and not on the live site. The live site's address is probably not on the key's list. See the next section.

"Online booking … isn't enabled on this website"

The widget shows "Online booking for (your venue) isn't enabled on this website." when it is embedded on a site that is not listed against your key. Fix it in the dashboard: Settings → Integrations → Your own website or app → your key, and add the address.

Addresses are matched exactly, scheme included:

If your site is atList this
https://yourvenue.comhttps://yourvenue.com
https://www.yourvenue.comhttps://www.yourvenue.com — a separate entry
http://localhost:3000 (testing)http://localhost:3000
https://yourvenue.com/bookhttps://yourvenue.com — no path

Page builders sometimes preview on their own address (something.wixsite.com, yourname.webflow.io). Add that address as well while you are previewing.

If you are testing on a staging site, add the staging address too — or use the booking link, which has no address check.

"Online payments aren't set up"

The widget says something like "This venue hasn't set up online payments yet. Please call to book.", followed by your venue's phone number.

  • No gateway is connected for online bookings. Settings → Integrations → Razorpay → Manage, and make sure Dashboard (collect online) is on.
  • A different gateway is the one collecting. Leo Cal can take a payment with Razorpay only. If your online collection is set to Cashfree, PhonePe, PayU or Stripe, customers are told to call.
  • One branch isn't set up. If you collect per branch, the message names the branch; the others still work.

A booking can't be made

The widget shows the API's own message. The common ones:

MessageMeaning
That slot has already started. Pick a later time.The start time is in the past.
Bookings open N days ahead. Pick an earlier date.The date is beyond your maximum advance days.
Bookings here are at least N minutes.The length is shorter than your shortest booking.
Bookings here are N minutes, then longer in M-minute steps.The length falls between two of your steps, such as 75 minutes with half-hour steps.
(court) is under maintenance.The court is switched off on the dashboard.
The slot is no longer availableSomeone else holds or booked it — usually moments earlier. The customer picks another.

A customer paid, and there is no booking

Work from the top:

  1. Search Razorpay for the payment, and note its order and payment ids.
  2. Is the webhook set up? If not, a customer who closed the page right after paying is charged but not booked. Set it up now — see the Razorpay webhook — and in Razorpay's webhook screen look for the failed payment.captured delivery and retry it if Razorpay offers that. The booking is confirmed if the court is still free; Razorpay also retries failed deliveries on its own for a day.
  3. Check Bookings for that customer, filtering by phone. If the hold had expired and the court was sold, the payment is refunded automatically, and the booking history shows Online Payment Refunded. The customer is told to expect it in 5–7 working days.
  4. Wrong mode. A webhook added in Razorpay's Test mode does nothing for Live payments (and vice versa). Test and Live webhooks are separate.
  5. Wrong secret. A webhook whose secret does not match the one in the dashboard is rejected, and the rejection is logged. Generate the secret in the dashboard and paste that exact value into Razorpay.

Test payment says "failed"

Use Razorpay's published test cards and UPI ids, in Test mode, with Test keys connected. A live key with a test card — or the reverse — fails at Razorpay, not here.

The card flickers or jumps in height

The card resizes itself to its content as the customer moves between steps. If it fights your layout, check that nothing forces the div's height (height, max-height, overflow: hidden) — let the div size itself, and control only its width and position.

Two widgets on one page

Fine. Cards and buttons can sit side by side. Give each data-sport or data-branch if they should open on different things. If they belong to different venues, give each its own data-key.

Still stuck?

Send the venue's short name, what you clicked, what you expected, and any console message or booking reference to Turfleo support. A booking reference (it looks like XCB9901) lets us find the exact checkout and its payment.

On this page