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:
@@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user