Skip to content

[Phase 3] Collect the balance from our page, not an emailed Stripe link #157

Description

@Davidslv

Epic: #151
Proposal: proposals/bookings_engine.md (local, git-excluded). Argument: https://github.com/Davidslv/notes/issues/178

Purpose

The balance is due later, sometimes months later. A Checkout link dies within 24 hours. The email points at our page. The session is created when the guest opens it.

Scope

In scope

  • After confirm, create the balance instalment for price_cents minus the deposit. A null deposit_cents is one full instalment and does not create a balance.
  • RequestDueInstalmentsJob emails a Bookings URL, not a Stripe URL. It skips rejected, cancelled, and expired.
  • Opening the page publishes booking.balance_due.bookings with the same fields as booking.held.bookings, plus the customer id already stored on the booking.
  • Billing reuses that customer. It does not create a second one. Session idempotency key is session- plus the balance payable_ref. Same inline exception as the deposit.
  • payment.succeeded.billing for a balance instalment marks it paid. It does not use the held check and it does not refund for failing that check.
  • The due job does not create the Stripe session.

Out of scope

  • Saving the card. Charging off-session.
  • A Stripe URL in the email.

How to deliver

Branch <issue-number>-balance-page. PR title [#<issue-number>] Collect the balance when the guest opens the page.

Acceptance Criteria

  • The due email contains the Bookings URL and no checkout.stripe.com URL.
  • Opening the page creates one session for that payable_ref and redirects to it.
  • A second open does not create a second session.
  • A succeeded balance marks the instalment paid and does not change a confirmed booking back to held or pending_review.
  • A rejected booking gets no balance email and no balance session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions