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')), // Leer, wenn der Teili die Bankverbindung selbst eintragen soll. accountOwner: Text::nullIfBlank($request->input('accountOwner')), accountIban: Text::nullIfBlank($request->input('accountIban')), // Leer, wenn der volle Beitrag erstattet wird -- dann gibt es nichts zu begründen. retentionReason: Text::nullIfBlank($request->input('retentionReason')), retentionReasonNote: Text::nullIfBlank($request->input('retentionReasonNote')), // Der Teili hat der Aktionsleitung gesagt, dass er spenden möchte -- dann entfällt die // Bankverbindung und die Erstattung wird sofort als Spende eingereicht. donation: $request->boolean('donation'), ); $response = new ReleaseRefundCommand($refundRequest)->execute(); return response()->json([ 'status' => $response->success ? 'success' : 'error', 'message' => $response->message, 'refund' => $response->refund?->toResource()->toArray($request), ]); } }