WordPress Revamp & Keycafe Self-Service Automation

Ben

Ben Kern

Verified

Case Study: Engineering a 100% Self-Service Rental System for 24/7 Trailer Rentals

Project Overview
24/7 Trailer Rentals needed to build a fully automated, 24/7 self-service rental platform. The goal was to connect their WordPress booking site to a Keycafe smartbox, allowing customers to book a trailer, pay, and receive key access at any time, day or night, with zero manual intervention.
The Challenge: A Broken Integration
The client had a clear vision, but the technical execution stalled on a critical failure. The entire automation hinged on a webhook connecting the booking platform to Keycafe via Zapier. This webhook was the linchpin. When a user booked, it was supposed to send the user's data (email, name) and the rental data (key ID) to Zapier, which would then provision access in Keycafe. The problem was twofold:
Incomplete Test Data: The webhook's test payload was incomplete, missing the crucial key and access objects. This made it impossible to map fields in Zapier's visual editor.
Malformed Production Data: The raw payload was not valid JSON. It was a custom key-value string format, with unquoted keys (actor: True) and malformed string sections. Standard parsers like JSON.parse (JavaScript) and ast.literal_eval (Python) failed, making it impossible to read the data. The project was dead in the water. Without a way to parse this payload, the self-service dream was impossible.
The Solution: Custom Python Parsing & Front-End Polish
I was brought in to solve this integration crisis and polish the user experience. The solution was a two-part process:
Backend: Engineering a Custom Python Parser
Since standard tools failed, I built a solution from scratch. I switched the Zapier code step from JavaScript to Python to build a more robust, manual parser. My script was designed to be resilient and handle the "messy" data:
• Line-by-Line Reading: Instead of trying to parse the entire string at once, the script reads the raw payload line by line.
• Manual Key-Value Splitting: It splits each line by the first colon (:) to isolate the key and the value, stripping away whitespace.
• Safe Nested-Object Parsing: The most complex part was the user value, which was a string containing a nested object (e.g., user: {'email': '...', 'firstName': '...'}). My script identifies this specific line and uses Python's ast.literal_eval only on that single value to safely parse it into a dictionary.
• Future-Proofing: This "line-by-line" approach means that when the production payload finally arrived (with the key, location, and access fields), the script would parse them just as easily as the test data, ensuring a seamless transition from testing to live.
Front-End: Revamping the WooCommerce Booking Experience
With the backend automation fixed, I turned to the client's website to improve the user flow.
• Dynamic "Add-ons" Link: I wrote a custom PHP snippet that hooks into WooCommerce to automatically display a "See all available add-ons" link on the booking form. This link was strategically set to appear only on specific product categories (e.g., cargo-trailers, dump-trailers), guiding the user to up-sell opportunities.
• Targeted CSS Styling: The booking form's text was hard to read. Using browser developer tools, I wrote highly specific CSS to override the theme's defaults. This made all add-on titles, labels, and the new link white and left-aligned, matching the client's brand and improving readability.
• Gallery Fix: I also diagnosed and fixed a layout issue where the product image gallery was incorrectly showing thumbnails for single-image products, streamlining the page design.
The Outcome
The custom Python script successfully parsed the malformed webhook, bridging the gap between WordPress and Keycafe.
This solution unlocked the client's entire business model. The 24/7 Trailer Rentals platform is now fully automated, from booking to key pickup. This eliminates all manual data entry, cuts down on customer wait times, and allows the company to operate 24/7/365, just as its name promises. The front-end improvements created a more professional, user-friendly booking experience to match the high-tech backend.
Tools & Skills Used
• WordPress
• WooCommerce
• PHP
• CSS
• Browser Developer Tools
• Zapier
• Python
• Webhook Debugging
• API Integration
• String Parsing (Manual & ast.literal_eval)
Like this project

Posted Nov 17, 2025

Revamped a WordPress trailer rental site. Built a custom Keycafe integration using Zapier & Python to parse webhooks for 100% self-service, automated rentals.

Likes

1

Views

0

Timeline

Oct 16, 2025 - Nov 16, 2025

Clients

24 7 Trailer Rentals, LLC