Skip to content

feat(events): on-chain crypto refund flow on event cancellation - #108

Merged
manoahLinks merged 1 commit into
mainfrom
feat/organizer-functions
Jul 21, 2026
Merged

feat(events): on-chain crypto refund flow on event cancellation#108
manoahLinks merged 1 commit into
mainfrom
feat/organizer-functions

Conversation

@manoahLinks

Copy link
Copy Markdown
Contributor

Wire up the refund processing deferred in cancelEvent. Cancelling a PUBLISHED event with sold tickets now fans out one on-chain claimRefund per confirmed, minted crypto (USDC) ticket, signed by the buyer's Circle wallet (the contract gates on token ownership). Fiat tickets can't be refunded on-chain (claimRefund reverts FiatTicketNotRefundable) and are logged as needing off-chain handling.

  • schema: BlockchainTxType.REFUND + Ticket.refundedAt/refundTxHash
  • RefundQueueService: producer mirroring the mint queue (5 attempts, exp backoff, eager BlockchainTransaction audit row)
  • RefundProcessor: claimRefund via buyer wallet, webhook-or-poll completion, terminal-vs-retryable revert classification (RefundPeriodExpired/NotEnabled/etc → UnrecoverableError)
  • RefundFinalizerService: idempotent REFUNDED flip + soldCount release
  • circle-webhook.processor: route confirmed REFUND txs to finalizer
  • cancelEvent: enqueue refunds for crypto tickets

Tests: refund.processor (7) + events.cancel (3); suite green.

Wire up the refund processing deferred in cancelEvent. Cancelling a
PUBLISHED event with sold tickets now fans out one on-chain claimRefund
per confirmed, minted crypto (USDC) ticket, signed by the buyer's Circle
wallet (the contract gates on token ownership). Fiat tickets can't be
refunded on-chain (claimRefund reverts FiatTicketNotRefundable) and are
logged as needing off-chain handling.

- schema: BlockchainTxType.REFUND + Ticket.refundedAt/refundTxHash
- RefundQueueService: producer mirroring the mint queue (5 attempts,
  exp backoff, eager BlockchainTransaction audit row)
- RefundProcessor: claimRefund via buyer wallet, webhook-or-poll
  completion, terminal-vs-retryable revert classification
  (RefundPeriodExpired/NotEnabled/etc → UnrecoverableError)
- RefundFinalizerService: idempotent REFUNDED flip + soldCount release
- circle-webhook.processor: route confirmed REFUND txs to finalizer
- cancelEvent: enqueue refunds for crypto tickets

Tests: refund.processor (7) + events.cancel (3); suite green.
@manoahLinks
manoahLinks merged commit 4ed7e50 into main Jul 21, 2026
3 checks passed
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.

1 participant