$participantToken])->first(); if (null === $participant) { return response()->json(['message' => 'Participant not found'], 404); } // Die GiroCode-Erzeugung gehört zum Zahlungsmodul; ohne diese Fähigkeit (z.B. Barzahlung) -> 404. $module = $participant->paymentModule(); $girocode = $module instanceof ProvidesGiroCode ? $module->giroCode($participant, $participant->paymentConfiguration()) : null; if ($girocode === null) { return response()->json(['message' => 'No giro code for this payment method'], 404); } return response($girocode, 200, ['Content-Type' => 'image/png']); } }