Package springboot.bg.harisauto.dev
Class DevPaymentController
java.lang.Object
springboot.bg.harisauto.dev.DevPaymentController
DevPaymentController.java - Simulates a successful payment without calling Stripe.
Registered only under the "dev" profile. Previously this mapping lived in
PaymentController and was guarded at runtime by app.dev-mode.enabled,
which meant a free-checkout endpoint was present in the production artifact and one
property away from being live. Gating on the profile removes the mapping entirely
outside development.
- Author:
- Kristian Popov
-
Constructor Summary
ConstructorsConstructorDescriptionDevPaymentController(CheckoutService checkoutService, ShoppingCart shoppingCart) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.web.servlet.ModelAndViewsimulatePaymentSuccess(jakarta.servlet.http.HttpSession session, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) Completes the pending booking as if the payment had succeeded.
-
Constructor Details
-
DevPaymentController
Constructor.
-
-
Method Details
-
simulatePaymentSuccess
@PostMapping("/dev/simulate-payment-success") public org.springframework.web.servlet.ModelAndView simulatePaymentSuccess(jakarta.servlet.http.HttpSession session, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) Completes the pending booking as if the payment had succeeded.- Parameters:
session- The HTTP session holding the pending booking.redirectAttributes- Flash attributes for the redirect.- Returns:
- Redirect to the invoices page.
-