Package org.hoteia.qalingo.core.pojo.cart

Examples of org.hoteia.qalingo.core.pojo.cart.CommonCartPojoResponse


   
    @GET
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse getCart(GetCartPojoRequest getCartPojoRequest) {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (!(authentication instanceof AnonymousAuthenticationToken)) {
            String currentCustomerName = authentication.getName();
           
            if(StringUtils.isNotEmpty(currentCustomerName)){
                Customer customer = customerService.getCustomerByLoginOrEmail(currentCustomerName);

                if(StringUtils.isNotEmpty(getCartPojoRequest.getMarketAreaCode())){
                    MarketArea marketArea = marketService.getMarketAreaByCode(getCartPojoRequest.getMarketAreaCode());
                    try {
                        CartPojo cartPojo = checkoutPojoService.getCart(marketArea, customer);
                        commonCartPojoResponse.setCart(cartPojo);
                    } catch (Exception e) {
                        // TODO SEND ERREUR
                    }
                }
            } else {
View Full Code Here


    @PUT
    @Path("items")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse updateProductSkuQuantityToCart(UpdateItemQuantityCartPojoRequest updateItemQuantityCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        if(StringUtils.isNotEmpty(updateItemQuantityCartPojoRequest.getCartId())){
            Cart cart = cartService.getCartById(updateItemQuantityCartPojoRequest.getCartId());
            String productSkuCode = updateItemQuantityCartPojoRequest.getProductSkuCode();
            int quantity = updateItemQuantityCartPojoRequest.getQuantity();
View Full Code Here

    @DELETE
    @Path("items")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse deleteProductSkuQuantityToCart(UpdateItemQuantityCartPojoRequest updateItemQuantityCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        if(StringUtils.isNotEmpty(updateItemQuantityCartPojoRequest.getCartId())){
            Cart cart = cartService.getCartById(updateItemQuantityCartPojoRequest.getCartId());
            String productSkuCode = updateItemQuantityCartPojoRequest.getProductSkuCode();
            checkoutPojoService.deleteCartItem(cart, productSkuCode);
View Full Code Here

    @POST
    @Path("promocode")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse applyPromoCode(PromoCodeCartPojoRequest promoCodeCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        if (StringUtils.isNotEmpty(promoCodeCartPojoRequest.getCartId())) {
            Cart cart = cartService.getCartById(promoCodeCartPojoRequest.getCartId());
            String promoCode = promoCodeCartPojoRequest.getPromoCode();
View Full Code Here

    @POST
    @Path("shipping-address")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse setShippingAddress(AddressCartPojoRequest addressCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (!(authentication instanceof AnonymousAuthenticationToken)) {
            String currentCustomerName = authentication.getName();
           
View Full Code Here

    @POST
    @Path("billing-address")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse setBillingAddress(AddressCartPojoRequest addressCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (!(authentication instanceof AnonymousAuthenticationToken)) {
            String currentCustomerName = authentication.getName();
           
View Full Code Here

    @POST
    @Path("delivery-method")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public CommonCartPojoResponse setDeliveryMethod(DeliveryMethodCartPojoRequest deliveryMethodCartPojoRequest) throws Exception {
        CommonCartPojoResponse commonCartPojoResponse = new CommonCartPojoResponse();
       
        if(StringUtils.isNotEmpty(deliveryMethodCartPojoRequest.getCartId())){
            Cart cart = cartService.getCartById(deliveryMethodCartPojoRequest.getCartId());
            String deliveryMethodCode = deliveryMethodCartPojoRequest.getDeliveryMethodCode();
            checkoutPojoService.setDeliveryMethod(cart, deliveryMethodCode);
View Full Code Here

TOP

Related Classes of org.hoteia.qalingo.core.pojo.cart.CommonCartPojoResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.