Skip to content

Commit

Permalink
Add a clause if it is PAID already so not checking mollie (#555)
Browse files Browse the repository at this point in the history
This function was not tested before and needs to be done in the future Issue #556 is made for this.
  • Loading branch information
ArdyZ authored Dec 29, 2021
1 parent d8645e3 commit 9cd7086
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import ch.wisv.areafiftylan.exception.OrderNotFoundException;
import ch.wisv.areafiftylan.exception.TicketNotFoundException;
import ch.wisv.areafiftylan.exception.TicketUnavailableException;
import ch.wisv.areafiftylan.products.model.order.OrderStatus;
import ch.wisv.areafiftylan.products.model.AssignDTO;
import ch.wisv.areafiftylan.products.model.TicketDTO;
import ch.wisv.areafiftylan.products.model.order.Order;
Expand Down Expand Up @@ -270,7 +271,11 @@ public ResponseEntity<?> handleMollieTestCall() {
@JsonView(View.OrderOverview.class)
@GetMapping("/{orderId}/status")
public ResponseEntity<?> updateOrderStatusManual(@PathVariable long orderId) {
Order order = orderService.updateOrderStatusByOrderId(orderId);
Order order = orderService.getOrderById(orderId);
if (order.getStatus() == OrderStatus.PAID) {
return createResponseEntity(HttpStatus.OK, "Order status updated", order);
}
order = orderService.updateOrderStatusByOrderId(orderId);

log.info(controllerMarker, "Order {} updated", order.getId(), StructuredArguments.v("order_id", order.getId()));

Expand Down

0 comments on commit 9cd7086

Please sign in to comment.