A robust, commercial-grade simulator booking and membership platform designed for unstaffed 24/7 indoor golf facilities. This project demonstrates complex business logic orchestration between payment states, physical IoT access, and real-time communication.
- Engineered a recurring billing system supporting multiple membership tiers (ACE, BIRDIE).
- Implemented logic for automated prorating, billing cycle management, and plan transitions via Square's Subscription API.
- Successfully bridged the gap between software and hardware by integrating Smart Lock IoT services.
- Automated the generation of time-bound, unique guest PINs that activate and expire based on specific reservation windows.
- Built an automated notification system that delivers door access codes and booking reminders via SMS.
- Ensures a seamless user experience for unstaffed facility access through critical real-time alerts.
- Custom-built booking engine handles high-concurrency reservation attempts with strict overlap prevention.
- Implemented sophisticated hour-tracking logic to enforce tiered limits (e.g., "12 hours/month") and daily caps (e.g., "2 hours/day").
- Developed asynchronous listeners for Square's webhook events to handle the full payment lifecycle.
- Automatically updates membership status, handles payment failures, and triggers service suspensions in real-time.
- Implemented a secure OAuth 2.0 flow for the RemoteLock integration.
- Developed a self-healing token management system that automatically handles secret refresh cycles to ensure continuous IoT service availability.
- Designed a multi-level role system:
- Admin: Full system audit, booking management, and member oversight.
- Corporate: Primary accounts with the ability to manage and shares hours with "Child" members.
- Individual: Standard member access with personal booking history.
- Architected a unified payment flow handling both recurring subscriptions and one-time purchases (e.g., "Additional Hour" credits) using Square's secure tokenization.
graph TD
A[User Interface / Web] --> B{Business Logic Engine}
B --> C[MySQL Database]
B --> D[Square API]
B --> E[RemoteLock API]
B --> F[Twilio API]
D -- Webhooks --> G[Payment Lifecycle Handler]
G --> C
E -- IoT PINs --> B
B -- SMS Delivery --> F
subgraph "External Integrations"
D
E
F
end
- Backend: PHP (Vanilla / Procedural) with PDO for secure DB operations.
- Database: MySQL - Relational mapping for users, memberships, and IoT access logs.
- Frontend: Bootstrap 5, jQuery, DataTables for a responsive administrative Experience.
- Security: Square Payment Form (PCI-DSS compliant), unique PIN generation, and secure session management.
/config: Central API registry and environment configuration./models: Core domain logic for booking validations and subscription states./webhooks: Event-driven scripts for handling third-party API callbacks./remotelock: Enterprise integration logic for IoT door access./admin: Full-featured administrative suite.
- Clone the repository.
- Rename
config/db.php.exampletoconfig/db.php. - Configure your API credentials (Square, Twilio, RemoteLock).
- Point your web server to the root directory.
Developed as a high-performance solution for the niche indoor sports market, solving the 'staffing vs. accessibility' challenge via automation.