Unpriced bookings error at payment step, free lessons stuck pending, students can't see their sessions #53

Closed
opened 2026-07-05 19:42:13 +00:00 by thatguygriff · 0 comments
Owner

Bugs

Found while testing booking without Stripe configured (slot not tied to a priced offering):

  1. "Could not start payment for this registration." on every unpriced booking. POST /bookings only creates a payment row when the slot's offering has a price > 0 (src/Booking/BookingEndpoint.php), but assets/js/booking.js calls POST /payments/intent unconditionally after booking. With no payment row, PaymentService::createIntent() returns null and the endpoint responds 400. The student sees an error even though the booking succeeded and the slot was claimed — backend shows a pending lesson while the student thinks it failed. Same pattern applies to group-class enrollments (assets/js/group-classes.js).

  2. Free/unpriced lessons stay pending forever. Lessons are only confirmed via payment finalization or manual admin status change. A booking with nothing owed should be confirmed immediately.

  3. Students cannot see their booked sessions. GET /bookings (myLessons) exists server-side but nothing on the front end calls it. The booking page only lists open availability slots, so after booking, the slot disappears and the student's session is invisible to them.

Fix

  1. Include payment info in the booking/enrollment creation response (payment: null when nothing is owed) and have the JS skip payments/intent when there is no payment.
  2. Confirm zero-cost lessons immediately at booking time.
  3. Add a "Your upcoming lessons" section to the student booking page backed by GET /bookings, showing time and status (pending payment / confirmed).
## Bugs Found while testing booking without Stripe configured (slot not tied to a priced offering): 1. **"Could not start payment for this registration." on every unpriced booking.** `POST /bookings` only creates a payment row when the slot's offering has a price > 0 (`src/Booking/BookingEndpoint.php`), but `assets/js/booking.js` calls `POST /payments/intent` unconditionally after booking. With no payment row, `PaymentService::createIntent()` returns null and the endpoint responds 400. The student sees an error even though the booking succeeded and the slot was claimed — backend shows a `pending` lesson while the student thinks it failed. Same pattern applies to group-class enrollments (`assets/js/group-classes.js`). 2. **Free/unpriced lessons stay `pending` forever.** Lessons are only confirmed via payment finalization or manual admin status change. A booking with nothing owed should be confirmed immediately. 3. **Students cannot see their booked sessions.** `GET /bookings` (`myLessons`) exists server-side but nothing on the front end calls it. The booking page only lists open availability slots, so after booking, the slot disappears and the student's session is invisible to them. ## Fix 1. Include payment info in the booking/enrollment creation response (`payment: null` when nothing is owed) and have the JS skip `payments/intent` when there is no payment. 2. Confirm zero-cost lessons immediately at booking time. 3. Add a "Your upcoming lessons" section to the student booking page backed by `GET /bookings`, showing time and status (pending payment / confirmed).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#53