Owner: Dev Team | Last Updated: 2026-02-21 | Status: Current
A complete guide to the booking process -- from cost calculation to final payment.
Booking is the central business process of Booking. It includes:
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
│ Customer │ │ Frontend │ │ Backend │
│ (Browser) │ │ (Vue/Embed) │ │ (Laravel) │
└──────┬───────┘ └──────┬───────┘ └──────┬───────┘
│ │ │
│ Select experience │ │
│───────────────────>│ │
│ │ GET /api/v1/xp │
│ │───────────────────>│
│ │ Experience data │
│ │<───────────────────│
│ │ │
│ Choose date/time │ │
│───────────────────>│ │
│ │ Check availability│
│ │───────────────────>│
│ │ Available slots │
│ │<───────────────────│
│ │ │
│ Select tickets │ │
│───────────────────>│ │
│ │ POST get-cost │
│ │───────────────────>│
│ │ Cost breakdown │
│ │<───────────────────│
│ │ │
│ Apply coupon │ │
│───────────────────>│ │
│ │ POST get-cost │
│ │ (with coupon) │
│ │───────────────────>│
│ │ Updated cost │
│ │<───────────────────│
│ │ │
│ Enter payment │ │
│───────────────────>│ │
│ │ Stripe.js │
│ │ confirmPayment() │
│ │ │
│ │ POST create-booking│
│ │───────────────────>│
│ │ Booking confirmed│
│ │<───────────────────│
│ Confirmation page │ │
│<───────────────────│ │
Cost calculation is performed in BookingService::getBookingCost().
Base Price (per ticket type × quantity)
+ Additional Services
- Coupon Discount
- Gift Card Amount
+ Tax (8.875%)
± Dynamic Pricing Adjustment
─────────────────────────────
= Total Amount
| Component | Source | Description |
|---|---|---|
| Base Price | ExperiencePricing |
Price per ticket type (Adult, Child, etc.) |
| Additional Services | ExperienceAdditionalService |
Additional services |
| Coupon | Coupon model |
Percentage or fixed discount |
| Gift Card | GiftCardTransaction |
Deduction from gift card balance |
| Tax | .env TAX_RATE |
Tax (default 8.875%) |
| Dynamic Pricing | PricingRule + RuleCondition |
Automatic price adjustment |
Bookings managed directly through the Booking database.
Files:
app/Services/Booking/BookingService.php -- main logicapp/Services/OrderService.php -- Order creationapp/Services/PaymentService.php -- Payment creationBookings proxied through an external API (for tours/bikes from another system).
Files:
app/External/Proxy/ProxyService.php -- request proxyingcompany.api_url and company.token for authorizationBookings through Bokun and other OTAs.
Files:
app/Services/ChannelManager/BookingService.phproutes/channelManager.phpBookingService::getBookingCost()
→ StripeService::createPaymentIntent()
→ Stripe API: PaymentIntents.create (manual capture)
Note: Manual capture is used -- funds are authorized but not charged until confirmation.
// Frontend (Stripe.js)
stripe.confirmPayment({
elements,
confirmParams: { return_url: '...' }
})
BookingService::createBooking()
→ StripeService::capturePaymentIntent()
→ Stripe API: PaymentIntents.capture
OrderService::embedCreateOrder() // Create Order
PaymentService::createPayment() // Create Payment record
→ OrderPaidAction // Send confirmation email
Embed is a standalone SPA for embedding the booking form on external websites.
resources/js/embed/embed-app.ts -- main entry pointresources/js/embed/embed-api.ts -- public widget API<!-- On a third-party website -->
<div id="anchor-booking-widget"></div>
<script src="https://your-domain.com/build/assets/embed-api.js"></script>
| Status | Value | Description |
|---|---|---|
CONFIRMED |
- | Booking confirmed |
CANCELED |
- | Booking canceled |
REBOOKED |
- | Rebooked to a different date |
ACTIVE |
- | Active |
PENDING |
- | Awaiting confirmation |
| File | Purpose |
|---|---|
app/Services/Booking/BookingService.php |
Main booking logic |
app/Services/Booking/CheckAvailabilityService.php |
Availability check |
app/Services/OrderService.php |
Order creation |
app/Services/PaymentService.php |
Payment management |
app/External/Stripe/StripeService.php |
Stripe integration |
app/Services/ReservationCacheService.php |
Reservation caching |
app/Http/Controllers/Web/BookingController.php |
Web controller |
app/Http/Controllers/Embed/EmbedController.php |
Embed controller |
resources/js/embed/ |
Frontend embed widget |
resources/js/pages/bookings/ |
Admin booking pages |
| Date | Author | Change |
|---|---|---|
| 2026-02-21 | Documentation Team | Initial creation |
Up: Guides