ServiceLoom Market
A Bubble marketplace migration that reconciled bookings, payments and refunds
- Scale
- Service marketplace
- Bubble
20days
Delivery
0
Duplicate event effects
0
Payment reconciliation
11s
93.9% lower
Event-processing delay, p95
Illustrative before/after figures.
The product
Buyers selected a service and paid for a booking. Providers viewed accepted work, while administrators handled cancellation and the existing refund process. The marketplace used Stripe as its existing provider; its account and payout arrangement stayed unchanged. The app stored external references and status, not card details. Those references connected a customer-facing booking to the financial events that determined what the operator could safely do next.
The challenge
The story began with bookings that could appear paid at the provider but pending in the app. Browser redirects, delayed webhooks and lost refund responses were being treated too similarly. The team traced each path and retained the established payment model. The reason for rebuilding was a reviewable transaction flow and a maintainable integration, not a new payout design. A successful checkout screen alone could not demonstrate recovery from an ambiguous refund.
The operations lead had bookings marked paid locally while the payment provider showed a different state. Repeated webhook delivery made an already confusing queue harder to investigate. We defined the provider as the financial authority and separated payment intent, confirmed payment, refund and unknown outcome. The brief asked for a recoverable transaction trail, not a new marketplace payout system. Existing provider references and exact monetary values were indispensable.
How we tackled it
- 01
Separate the states. Booking acceptance and payment status received explicit transitions; a browser redirect could not by itself establish payment success.
- 02
Process events once logically. Verified event IDs were persisted and replayed safely, with duplicates and ordering handled by the state model.
- 03
Record refund intent. An operation was stored before the external call, and an uncertain result was reconciled before another request was issued.
- 04
Expose exceptions. An operator queue linked each mismatch to booking, provider references and recovery instructions.
What we built
Next.js, TypeScript and Tailwind implemented the product. Postgres with Drizzle stored booking states, event records and operation references. The Stripe SDK replaced the existing plugin integration, while a durable worker handled events and reconciliation. Managed authentication enforced the three roles. Correlation identifiers joined provider activity to application transitions, allowing an engineer to follow the same operation across systems without placing card data in the database.
The rehearsal replayed delayed and repeated events, lost a refund response and simulated a provider outage. A fixed provider export was reconciled with booking records. At cutover, new checkout initiation paused while in-flight sessions and recent events were accounted for; one processing route then owned mutations. Recovery retained subsequent provider acknowledgements. The story's acceptance occurred in a test environment and does not assert real money movement or production payment success.
Before & after — illustrative results
The illustrative ledger starts with 37 unresolved booking/provider exceptions and ends with each accounted for. Replay results are evaluated against expected final states, not merely successful HTTP responses. Processing delay is measured at 20 events per second under healthy-provider conditions. The example demonstrates how transaction evidence can be structured; it does not claim higher marketplace revenue, lower provider fees or an actual client incident reduction.
Illustrative before/after values. No tests or client measurements were performed for this story. The comparison conditions describe how an equivalent real migration would be evaluated; they are not a test report.
| Metric | Before | After | Comparison conditions |
|---|---|---|---|
| Duplicate event effects | 46 duplicate transitions/intents in a 10,000-event replay | 0 duplicate transitions/intents | Same repeated, delayed and reordered test-mode events; compare final states. |
| Payment reconciliation | 37 unresolved exceptions across 5,000 bookings | 0 unresolved fixture exceptions | Compare exact amounts, currencies and external references against a fixed export. |
| Event-processing delay, p95 | 180 seconds | 11 seconds — 93.9% lower | 20 events/second for 20 minutes; healthy-provider conditions. |
| Critical marketplace journeys | 18/24 pass in rehearsal | 24/24 pass | Buyer, provider and administrator paths; test environment only. |
| Resolve a payment mismatch, median | 22 min | 6 min | Twenty provider/local mismatch fixtures; same operator and exact references; verify final state, not just dismissal of an alert. |
| Booking details LCP, lab p75 | 5.0 s | 2.1 s — 2.4× faster | Ten representative bookings; 40 authenticated loads each; fixed network; payment-provider pages excluded. |
The outcome
ServiceLoom ended the story with an administrator who could distinguish a failed payment from an unapplied event and investigate an ambiguous refund without blindly repeating it. Handover included replay tooling, provider references and exception procedures. The case shows why marketplace migration proposals need to cover operational failure paths alongside the visible booking and checkout journey.
Why these improvements mattered
Operators gained a specific next action for pending, failed and unknown outcomes. A durable event trail shortened investigation without assuming every discrepancy could be automatically repaired. The financial correctness checks mattered more than the faster booking-details page.
Scope & timeline
Scope
Scale delivered the buyer/provider/admin journeys, payment-state model, event processor and mismatch queue. Bubble to Code preserved customer, payment and refund references and documented the provider's supported retry behaviour. New split payments and dispute automation remained outside scope. The selected delivery made pending, failed and unknown outcomes visible to the operator, who needed a different action for each.
Delivery timeline
Delivery schedule: 20 working days. Team: Two engineers, shared QA and the marketplace operations lead. The clock starts after scope approval, usable source data, test access and agreed UI are available. Waiting for external approvals is excluded. This is a bounded example, not a turnaround guarantee.
Days 1–4: map booking/payment states and provider retry rules.
Days 5–13: build durable event processing and the exception queue.
Days 14–18: replay failures and reconcile test-mode payment records.
Days 19–20: switch event handling and monitor the accepted launch set.
FAQ
- Can an existing payment provider stay in place during migration?
- Yes. Preserve external identifiers and the existing commercial arrangement while rebuilding and validating the application integration.
- How should a migration handle a refund request that times out?
- Record the intended operation and reconcile the provider outcome before retrying; a lost response does not prove that the refund failed.
Discuss a similar migration
Bring a paid-but-pending booking and your existing refund rules. Bubble to Code can trace transaction ownership and determine the scope of a Scale migration. Agree the recovery demonstration for a timeout before adding new providers or changing marketplace economics.
