@Path(value="shops/{shopId}/carts")
public final class CartResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private CartService |
cartService |
private java.lang.String |
cartToken |
private OrderService |
orderService |
private java.lang.String |
shopId |
private ShopRequestContextService |
shopReqCtxService |
Constructor and Description |
---|
CartResource(ShopRequestContextService shopReqCtxService,
CartService cartService,
OrderService orderService) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
addCoupon(java.lang.String shopId,
GUID cartId,
Coupon coupon) |
javax.ws.rs.core.Response |
addCoupon(java.lang.String shopId,
GUID cartId,
java.lang.String code) |
javax.ws.rs.core.Response |
changeLocale(java.lang.String shopId,
GUID cartId,
Locale locale) |
javax.ws.rs.core.Response |
changeLocale(java.lang.String shopId,
GUID cartId,
java.util.Locale locale) |
javax.ws.rs.core.Response |
create(CartInput cartIn) |
javax.ws.rs.core.Response |
createOrderForCart(java.lang.String shopId,
GUID cartId) |
javax.ws.rs.core.Response |
get(GUID cartId,
java.lang.Boolean includeTax) |
javax.ws.rs.core.Response |
removeCoupon(java.lang.String shopId,
GUID cartId,
GUID couponLineItemId) |
@PathParam(value="shopId") private java.lang.String shopId
@HeaderParam(value="X-ePages-Cart-Token") private java.lang.String cartToken
private final ShopRequestContextService shopReqCtxService
private final CartService cartService
private final OrderService orderService
@Inject public CartResource(ShopRequestContextService shopReqCtxService, CartService cartService, OrderService orderService)
@POST @Consumes(value="application/json") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value={"sf","products_read"}) public javax.ws.rs.core.Response create(CartInput cartIn)
@GET @Path(value="{cartId}") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value={"sf","products_read"}) public javax.ws.rs.core.Response get(@PathParam(value="cartId") GUID cartId, @DefaultValue(value="true") @QueryParam(value="includeTax") java.lang.Boolean includeTax)
@POST @Path(value="{cartId}/order") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value="orders_write") @Consumes(value="application/json") public javax.ws.rs.core.Response createOrderForCart(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId)
@POST @Path(value="{cartId}/coupon") @RolesAllowed(value={"sf","products_read"}) @Consumes(value="application/json") @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response addCoupon(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, Coupon coupon)
@POST @Path(value="{cartId}/coupon") @RolesAllowed(value={"sf","products_read"}) @Consumes(value="application/x-www-form-urlencoded") @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response addCoupon(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, @FormParam(value="code") java.lang.String code)
@DELETE @Path(value="{cartId}/coupon/{couponLineItemId}") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value={"sf","products_read"}) public javax.ws.rs.core.Response removeCoupon(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, @PathParam(value="couponLineItemId") GUID couponLineItemId)
@PUT @Path(value="{cartId}/locale") @Consumes(value="application/json") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value={"sf","products_read"}) public javax.ws.rs.core.Response changeLocale(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, Locale locale)
@PUT @Path(value="{cartId}/locale") @Consumes(value="application/x-www-form-urlencoded") @Produces(value="application/vnd.epages.v1+json, application/json") @RolesAllowed(value={"sf","products_read"}) public javax.ws.rs.core.Response changeLocale(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="cartId") GUID cartId, @FormParam(value="locale") @FullLocale java.util.Locale locale)