'error', 'text' => 'Bitte ein Mitglied auswählen.']; } else { $result = paypal_assign_payment($pdo, $tenantId, $paymentId, $participantId, $actorUserId); $flash = $result['ok'] ? ['type' => 'success', 'text' => 'Zahlung wurde zugeordnet und als Einzahlung gebucht.'] : ['type' => 'error', 'text' => $result['error'] ?? 'Die Zuordnung ist fehlgeschlagen.']; } } elseif ($aktion === 'ignorieren') { $result = paypal_ignore_payment($pdo, $tenantId, $paymentId, $actorUserId); $flash = $result['ok'] ? ['type' => 'success', 'text' => 'Zahlung wurde als erledigt markiert.'] : ['type' => 'error', 'text' => $result['error'] ?? 'Die Aktion ist fehlgeschlagen.']; } // Post-Redirect-Get gegen Doppelbuchung per Refresh. $_SESSION['flash_paypal'] = $flash; header('Location: paypal-zuordnung.php'); exit; } $inboxAddress = null; $offene = []; $mitglieder = []; if ($hasAccess) { $token = paypal_inbox_ensure_token($pdo, $tenantId); $inboxAddress = paypal_inbox_address_for_token($token); $offene = paypal_fetch_unmatched($pdo, $tenantId); $mitglieder = ledger_fetch_participant_summaries($pdo, $tenantId, ['active_only' => true]); } include "header.php"; include "headerline.php"; include "nav.php"; ?>