public DeleteOrder(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}</BUG>
public Consumer<Order> getConsumer() {
return (order) -> {
<BUG>if (order.getPaymentId() != null) {
String href = "http://payment-web/v1/payments/" + order.getPaymentId();
restTemplate.delete(href);
}</BUG>
order.getModule(OrderModule.class)

import org.springframework.stereotype.Service;
import java.util.function.Consumer;
@Service
public class DeleteOrder extends Action<Order> {
private final Logger log = Logger.getLogger(this.getClass());
private final PaymentService paymentService;
public DeleteOrder(PaymentService paymentService) {
this.paymentService = paymentService;
}
public Consumer<Order> getConsumer() {
return (order) -> {
if (order.getPaymentId() != null)
paymentService.delete(order.getPaymentId());
order.getModule(OrderModule.class)
