Add /donation/success route and flash messages for both outcomes

Cancelled donations now show "Donation failed, but thank you for
trying anyway." and successful ones show "Thank you for the
donation!" on the dashboard after redirect.
This commit is contained in:
Frank
2026-07-11 22:25:05 +02:00
parent c06c45cb52
commit aa667df889
+10
View File
@@ -33,6 +33,16 @@ final class HomeController extends AbstractController
#[Route(path: '/donation/cancel', name: 'website_donation_cancel')] #[Route(path: '/donation/cancel', name: 'website_donation_cancel')]
public function donationCancel(): Response public function donationCancel(): Response
{ {
$this->addFlash('info', 'Donation failed, but thank you for trying anyway.');
return $this->redirectToRoute('game_dashboard');
}
#[Route(path: '/donation/success', name: 'website_donation_success')]
public function donationSuccess(): Response
{
$this->addFlash('success', 'Thank you for the donation!');
return $this->redirectToRoute('game_dashboard'); return $this->redirectToRoute('game_dashboard');
} }
} }