The La Marie Beauty booking system requires a custom payment flow that neither Bookly nor WooCommerce can handle natively. The core requirement is a mixed cart supporting both products (charged immediately) and services (card stored but not charged at booking). Custom PHP code using Square's APIs bridges this gap.
This pattern was confirmed during a technical review call with developer Isahaque Mahmud and PM Kimberly Gehrmann. See [1] for project context.
The cart must support three purchase types simultaneously:
| Cart Contents | Payment Behavior |
|---|---|
| Products only | Charged in full at checkout |
| Services only | Card stored; no immediate charge |
| Mixed (products + services) | Products charged immediately; service card stored for later |
Service-specific payment rules:
- Card is not charged at booking
- Card is tokenized and stored for:
- No-show penalties
- Cancellation fees
- Final payment after service is rendered
Bookly and WooCommerce do not natively support deferred service charges or card-on-file without immediate payment. The only path to implement this flow is custom PHP code hooking into WordPress/WooCommerce's plugin system.
"For all those type of payment, we need to write some custom PHP code." — Isahaque Mahmud
WordPress and WooCommerce expose a hook system (actions and filters) that is PHP-only. Any backend customization — including payment flow logic — must use these hooks, making PHP non-negotiable for the server-side implementation.
Rather than building fully custom card handling, the implementation uses Square's APIs for card tokenization. This was an explicit recommendation from Kimberly Gehrmann to preserve two things:
The developer (Isahaque) confirmed this is achievable via Square API keys, which can be generated without requiring action from the client.
Customer Checkout
│
├── Product in cart?
│ └── WooCommerce standard charge (immediate)
│
└── Service in cart?
└── Custom PHP hook
└── Square API: tokenize card → store on customer profile
└── No charge triggered at booking
└── Card available for post-service charge / penalties
Key constraint: The Square API key is managed by the developer, not provisioned by the client. The client's Square account must be connected, but key creation is a developer task.
| Risk | Notes |
|---|---|
| PHP maintenance burden | Kimberly flagged she can read PHP but prefers JS; Isahaque confirmed PHP is required for WooCommerce hooks |
| Square API key management | Developer-held; needs handoff documentation before Asymmetric rolls off |
| Scope of custom code | Not yet written at call date; complexity unknown until implementation begins |