File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -397,12 +397,19 @@ public function cancelPayment(
397397 }
398398
399399 public function showChangePaymentPrice (
400+ Request $ request ,
400401 Response $ response ,
401402 Event $ event ,
402403 int $ paymentId ,
403404 ): Response {
404405 $ payment = $ this ->paymentRepository ->getById ($ paymentId , $ event );
405406
407+ if ($ payment ->status !== PaymentStatus::Waiting) {
408+ $ this ->flashMessages ->warning ('flash.warning.paymentNotWaitingCannotChangePrice ' );
409+
410+ return $ this ->redirect ($ request , $ response , 'admin-show-payments ' );
411+ }
412+
406413 return $ this ->view ->render ($ response , 'admin/changePaymentPrice.twig ' , ['payment ' => $ payment ]);
407414 }
408415
@@ -422,6 +429,12 @@ public function changePaymentPrice(
422429 return $ this ->redirect ($ request , $ response , 'admin-show-payments ' );
423430 }
424431
432+ if ($ newPrice < 0 || $ newPrice > 99999 ) {
433+ $ this ->flashMessages ->warning ('flash.warning.paymentNotWaitingCannotChangePrice ' );
434+
435+ return $ this ->redirect ($ request , $ response , 'admin-show-payments ' );
436+ }
437+
425438 $ this ->participantService ->changePaymentPrice ($ payment , $ newPrice , $ reason );
426439 $ this ->flashMessages ->success ('flash.success.paymentPriceChanged ' );
427440 $ this ->logger ->info ('Payment ID ' . $ paymentId . ' price changed to ' . $ newPrice . ' with reason: ' . $ reason );
You can’t perform that action at this time.
0 commit comments