eventParticipants->getByIdentifier($participantIdentifier, $this->events); if ($participant === null) { abort(403, 'Zugriff verweigert.'); } $refundRequest = new ReleaseRefundRequest( participant: $participant, amount: Amount::fromString((string) $request->input('amount'), 'Euro'), reason: (string) $request->input('reason'), reasonNote: Text::nullIfBlank($request->input('reasonNote')), ); $response = new ReleaseRefundCommand($refundRequest)->execute(); return response()->json([ 'status' => $response->success ? 'success' : 'error', 'message' => $response->message, 'refund' => $response->refund?->toResource()->toArray($request), ]); } }