A WordPress plugin that serializes QuanticaLabs CRBS booking data and sends to Zoho Flow webhook. Currently in debug mode - payloads are output to console/admin page for testing.
This plugin follows Domain-Driven Design (DDD) principles with clear separation of concerns:
crbs-zoho-flow-bridge/
├── zoho-connect-serializer.php # Main plugin file
├── uninstall.php # Uninstall script
├── includes/
│ ├── Autoloader.php # PSR-4 autoloader
│ ├── Core/
│ │ ├── Plugin.php # Main plugin class
│ │ ├── Activator.php # Activation handler
│ │ ├── Deactivator.php # Deactivation handler
│ │ ├── Config.php # Configuration manager
│ │ └── DependencyInjection/
│ │ └── Container.php # DI container
│ ├── Domain/ # Domain layer (business logic)
│ │ ├── Booking/
│ │ │ ├── Entities/
│ │ │ │ └── BookingPayload.php
│ │ │ ├── Repositories/
│ │ │ │ └── BookingPayloadRepository.php
│ │ │ └── Services/
│ │ │ └── BookingService.php
│ │ ├── CRBS/
│ │ │ └── Integrations/
│ │ │ └── CRBSIntegration.php
│ │ ├── Serialization/
│ │ │ └── Services/
│ │ │ └── SerializationService.php
│ │ └── Webhook/
│ │ └── Services/
│ │ └── ZohoFlowWebhookService.php
│ └── Infrastructure/ # Infrastructure layer
│ ├── API/
│ │ ├── Router.php
│ │ └── Controllers/
│ │ └── BookingController.php
│ ├── Http/
│ │ └── HttpClient.php
│ ├── Debug/
│ │ └── DebugService.php
│ ├── Logging/
│ │ └── Logger.php
│ ├── WordPress/
│ │ └── Hooks/
│ │ └── HookManager.php
│ └── Admin/
│ ├── AdminPage.php
│ └── Settings.php
└── templates/
└── admin/
└── settings-page.php
Contains business logic and domain entities:
- Entities: Domain objects representing business concepts
- Repositories: Data access abstraction
- Services: Business logic and orchestration
Handles technical concerns:
- API: REST API routing and controllers
- Http: HTTP client for external requests
- Logging: Logging functionality
- WordPress: WordPress-specific integrations
- Admin: Admin interface
Core plugin functionality:
- Plugin: Main plugin class and service registration
- Config: Configuration management
- DependencyInjection: Service container
- ✅ CRBS Integration: Automatically hooks into CRBS booking saves
- ✅ Payload Serialization: Transforms CRBS booking data to Zoho Flow format
- ✅ Debug Mode: Output payloads to console (error_log) or admin page
- ✅ Admin Interface: View all processed payloads with JSON display
- ✅ Webhook Ready: Infrastructure ready for Zoho Flow webhook (currently disabled in debug mode)
- ✅ Retry Mechanism: Built-in retry logic for failed webhook requests
- ✅ Comprehensive Logging: Configurable logging system
- ✅ Dependency Injection: Clean service container architecture
- ✅ Modular Design: Domain-driven design with separation of concerns
- Upload the plugin folder to
/wp-content/plugins/ - Ensure CRBS (Quantica Labs) plugin is installed and active
- Activate "CRBS → Zoho Flow Bridge" through the 'Plugins' menu in WordPress
- Configure settings in Zoho Flow Bridge → Settings
- View processed payloads in Zoho Flow Bridge → View Payloads
- WordPress 5.8+
- PHP 7.4+
- CRBS (Quantica Labs) plugin must be installed and active
Configure the plugin through Zoho Flow Bridge → Settings:
- Zoho Flow Webhook URL: Your Zoho Flow webhook endpoint (optional for now - debug mode)
- Debug Output Method: Choose how to output payloads:
- Console: Output to PHP error_log (check your server logs)
- Admin Page: Store payloads for viewing in admin
- Both: Output to both console and admin page
- Enable Logging: Toggle logging on/off
- Log Level: Set minimum log level (debug, info, warning, error)
Currently, the plugin is in debug mode. When a CRBS booking is saved:
- The booking data is captured automatically
- It's serialized into Zoho Flow format
- Based on your settings, it's output to:
- Console: Check your PHP error_log file
- Admin Page: View in Zoho Flow Bridge → View Payloads
To enable actual webhook sending, you'll need to modify the BookingService::process_crbs_booking() method.
- CRBS Hook: When a CRBS booking is saved/updated, the plugin automatically captures it
- Status Filter: Only processes bookings with status IDs 2 or 4 (confirmed/accepted) by default
- Serialization: Transforms CRBS booking data into Zoho Flow format:
- Customer information (name, email, phone)
- Booking dates (pickup, return)
- Invoice details (currency, line items)
- Output: Based on settings, outputs to console or admin page
- Prevention: Prevents duplicate processing (can be bypassed with
QZB_FORCE_RESENDconstant)
- List View: Go to Zoho Flow Bridge → View Payloads to see all processed bookings
- Detail View: Click "View Payload" to see the full JSON payload for a specific booking
- Copy JSON: Use the "Copy JSON" button to copy the payload for testing
- Domain Logic: Add to
includes/Domain/ - Infrastructure: Add to
includes/Infrastructure/ - Service Registration: Register in
Plugin::register_services()
- Follow WordPress Coding Standards
- Use PSR-4 autoloading
- Maintain separation of concerns
- Write self-documenting code
GPL-2.0+