Skip to content

Add partial refund support for multi-ticket CampTix orders#54

Closed
dd32 wants to merge 2 commits intoproductionfrom
add/claude/1553-partial-refund
Closed

Add partial refund support for multi-ticket CampTix orders#54
dd32 wants to merge 2 commits intoproductionfrom
add/claude/1553-partial-refund

Conversation

@dd32
Copy link
Copy Markdown
Owner

@dd32 dd32 commented Mar 12, 2026

Summary

  • When multiple tickets are purchased in a single order, the refund form now shows checkboxes to select which tickets to refund instead of requiring all tickets to be refunded together
  • Adds partial refund amount support to Stripe (via amount parameter) and PayPal (via REFUNDTYPE=Partial and AMT) payment gateways
  • Only selected attendees are marked as refunded; remaining tickets stay active
  • Single-ticket orders continue to work exactly as before

Fixes WordPress#1553

How it works

  1. The refund request form detects multi-ticket orders (count($attendees) > 1)
  2. For multi-ticket orders, checkboxes are shown next to each attendee with their ticket type and price
  3. On submit, the refund amount is calculated from the selected attendees tix_ticket_discounted_price values
  4. For partial refunds, the amount is passed to the payment gateway API instead of issuing a full refund
  5. Only selected attendees are set to refund status; others remain published

Test plan

  • Purchase a single ticket and verify the refund form works as before (no checkboxes, full refund)
  • Purchase multiple tickets in one order and verify checkboxes appear on the refund form
  • Select a subset of tickets and verify only those are refunded (attendee status changes to refund)
  • Verify the remaining tickets in the order stay active (status stays published)
  • Select all tickets in a multi-ticket order and verify a full refund is processed
  • Test with free tickets (organizer refund without payment transaction)
  • Verify refund notification emails are sent correctly for partial refunds

Generated with Claude Code

dd32 and others added 2 commits March 13, 2026 09:32
When multiple tickets are purchased in a single order, the refund form
now shows checkboxes allowing users to select which tickets to refund.
Previously, all tickets in an order had to be refunded together.

This adds partial refund support to both the Stripe and PayPal payment
gateways by passing the calculated refund amount to their respective
APIs. Only the selected attendees are marked as refunded, while the
remaining tickets in the order stay active.

Fixes WordPress#1553

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add explicit public visibility to payment_refund and send_refund_request
methods, and fix comment style from /* to /** for the PayPal docblock.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dd32
Copy link
Copy Markdown
Owner Author

dd32 commented Mar 24, 2026

Filed upstream: WordPress#1678

@dd32 dd32 closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant