OrderPayment orderPayment = wrapper.unwrap(request, context);
if (orderPayment.getOrder() != null && orderPayment.getOrder().getId().equals(cart.getId())) {
orderPayment = orderPaymentService.save(orderPayment);
OrderPayment savedPayment = orderService.addPaymentToOrder(cart, orderPayment, null);
OrderPaymentWrapper orderPaymentWrapper = (OrderPaymentWrapper) context.getBean(OrderPaymentWrapper.class.getName());
orderPaymentWrapper.wrapSummary(savedPayment, request);
return orderPaymentWrapper;
}
}
throw BroadleafWebServicesException.build(Response.Status.NOT_FOUND.getStatusCode())