wiki/knowledge/woocommerce/bookly-square-payment-integration.md · 534 words · 2025-12-02

Bookly + Square Payment Integration

Overview

Integrating Square as a payment gateway with Bookly requires custom PHP code to bridge the two systems. The core goal is to capture credit card information at checkout without necessarily charging the card immediately — a common pattern for service businesses that want to secure bookings with a card on file.

This integration is non-trivial. Bookly's native payment options do not include Square out of the box, so a custom PHP implementation is required to surface Square's payment fields within the Bookly checkout flow.

Known Issues

Credit Card Capture Failure

The most critical failure mode observed in practice: custom PHP code that successfully books the appointment but silently skips credit card capture.

In a live test on the [1] staging site (December 2025), the integration allowed a user to complete the booking flow and receive a confirmation — but no payment information was collected. The booking was created in the system with a $0 charge and no card on file.

Symptoms:
- Appointment is created in Bookly's calendar
- User receives a confirmation
- No credit card fields appear during checkout
- No payment record in Square dashboard

Root cause: The PHP hook into Bookly's checkout process was incomplete. The code registered the appointment but did not inject Square's card tokenization fields or submit the token to Square's API.

Resolution required: The PHP integration must:
1. Inject Square's Web Payments SDK card fields into the Bookly checkout step
2. Tokenize the card on form submission
3. Either charge the card or store the token (nonce) against the booking record

Integration Architecture

User selects service → Bookly modal/flow → Custom checkout step
                                                    ↓
                                        Square Web Payments SDK
                                        (card fields rendered here)
                                                    ↓
                                        Card tokenized client-side
                                                    ↓
                                        PHP sends nonce to Square API
                                        (charge or store on file)
                                                    ↓
                                        Bookly appointment confirmed

Implementation Notes

Open Questions (as of 2025-12-02)

Sources

  1. Index|La Marie Beauty
  2. Index|La Marie Beauty — Client Overview
  3. Bookly Ux Scope Misalignment|Bookly Ux & Scope Misalignment
  4. Bookly Custom Booking Flow|Bookly Custom Booking Flow (Cart First Ux)