Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hexclave/stack-auth
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dev
Choose a base ref
...
head repository: hexclave/stack-auth
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fix/reworked-refunds
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 12 files changed
  • 1 contributor

Commits on May 8, 2026

  1. payments: rework refund flow to three-knob API (amount, revoke, end-sub)

    Replaces the per-entry `refund_entries: [{ entry_index, quantity, amount_usd }]`
    schema with a flat `{ amount_usd, revoke_product, end_subscription? }` shape on
    the admin refund endpoint. Refund state is now derived from the bulldozer ledger
    (`refund:<sourceTxnId>:<uuid>` rows) rather than the legacy `refundedAt` Prisma
    column, so multiple partial refunds can run against a single purchase up to the
    remaining cap. Adds support for refunding any subscription invoice via
    `invoice_id` (start or renewal). Refund rows surface in the listing endpoint as
    `type: "refund"` with adjusted_by linkage that handles both new and legacy
    formats. Stripe idempotency keys are now derived from
    `(tenancyId, sourceTxnId, amount, prior_refunded)` so network retries dedupe at
    Stripe while intentional partials still get distinct keys. Dashboard refund
    dialog rebuilt around the three toggles. The `transaction-builder.ts` helpers
    that the old listing path used are gone — the listing reads bulldozer directly.
    
    Known follow-ups (documented in code): cap-check race window under concurrent
    refunds (a Postgres advisory lock would help, but bulldozer's embedded
    BEGIN/COMMIT prevents an outer Prisma tx from scoping the writes), and Stripe
    vs. DB non-atomicity if a write fails after a successful Stripe refund.
    BilalG1 committed May 8, 2026
    Configuration menu
    Copy the full SHA
    ca299a3 View commit details
    Browse the repository at this point in the history
Loading