Class DevPaymentController

java.lang.Object
springboot.bg.harisauto.dev.DevPaymentController

@Controller @Profile("dev") public class DevPaymentController extends Object
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 Details

  • 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.