Skip to content

[upstream #4594] feat(core, dashboard): Support pluggable refund destinations - #38

Open
ayim wants to merge 8 commits into
masterfrom
mirror/upstream-4594
Open

[upstream #4594] feat(core, dashboard): Support pluggable refund destinations#38
ayim wants to merge 8 commits into
masterfrom
mirror/upstream-4594

Conversation

@ayim

@ayim ayim commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Mirrored from vendurehq#4594 for the Overwatch review demo.

Original author: @oliverstreissi


Description

Add RefundDestinationStrategy interface allowing plugins to define alternative refund destinations (store credit, gift cards, etc.) instead of only refunding to the original payment method.

Backend:

  • New RefundDestinationStrategy interface with isAvailable/createRefund methods
  • refundDestinations query to discover available destinations per order
  • destination field on RefundOrderInput and Refund entity
  • Routes PaymentService.createRefund through destination strategy when specified
  • Startup validation rejecting strategies using reserved default code
  • Uses refundable payment capacity (not just Settled state) for availability checks

Dashboard:

  • Refund dialog split into "Payment methods" and "Other refund destinations" sections
  • Independent allocation with payments prioritized before destinations
  • Fix multi-target refund sending duplicate RefundLine records
  • Remove orphaned refundFragment and dead utility functions

Fixes vendurehq#4563

Breaking changes

None. Omitting destination in RefundOrderInput preserves existing behavior.

Screenshots

Screen.Recording.2026-03-31.at.10.21.26.mov

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Support pluggable refund destinations (e.g. refund to store credit)

2 participants