org.broadleafcommerce.core.web.api.endpoint.order
Class CartEndpoint
java.lang.Object
org.broadleafcommerce.core.web.api.endpoint.order.CartEndpoint
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware
@Component(value="blRestCartEndpoint")
@Scope(value="singleton")
public class CartEndpoint
- extends Object
- implements org.springframework.context.ApplicationContextAware
JAXRS endpoint for providing RESTful services related to the shopping cart.
User: Kelly Tisdell
Date: 4/10/12
|
Method Summary |
OrderWrapper |
addOfferCode(javax.servlet.http.HttpServletRequest request,
String promoCode,
boolean priceOrder)
|
OrderWrapper |
addSkuToOrder(javax.servlet.http.HttpServletRequest request,
javax.ws.rs.core.UriInfo uriInfo,
Long categoryId,
Long productId,
Long skuId,
int quantity,
boolean priceOrder)
This method takes in a categoryId and productId as path parameters. |
OrderWrapper |
createNewCartForCustomer(javax.servlet.http.HttpServletRequest request)
Create a new Order for Customer |
OrderWrapper |
findCartForCustomer(javax.servlet.http.HttpServletRequest request)
Search for Order by Customer |
OrderWrapper |
removeAllOfferCodes(javax.servlet.http.HttpServletRequest request,
boolean priceOrder)
|
OrderWrapper |
removeItemFromOrder(javax.servlet.http.HttpServletRequest request,
Long itemId,
boolean priceOrder)
|
OrderWrapper |
removeOfferCode(javax.servlet.http.HttpServletRequest request,
String promoCode,
boolean priceOrder)
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
OrderWrapper |
updateItemQuantity(javax.servlet.http.HttpServletRequest request,
Long itemId,
Integer quantity,
boolean priceOrder)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
orderService
protected OrderService orderService
offerService
protected OfferService offerService
customerService
protected CustomerService customerService
context
protected org.springframework.context.ApplicationContext context
CartEndpoint
public CartEndpoint()
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
findCartForCustomer
public OrderWrapper findCartForCustomer(@Context
javax.servlet.http.HttpServletRequest request)
- Search for
Order by Customer
- Returns:
- the cart for the customer
createNewCartForCustomer
public OrderWrapper createNewCartForCustomer(@Context
javax.servlet.http.HttpServletRequest request)
- Create a new
Order for Customer
- Returns:
- the cart for the customer
addSkuToOrder
public OrderWrapper addSkuToOrder(@Context
javax.servlet.http.HttpServletRequest request,
@Context
javax.ws.rs.core.UriInfo uriInfo,
Long categoryId,
Long productId,
Long skuId,
int quantity,
boolean priceOrder)
- This method takes in a categoryId and productId as path parameters. In addition, query parameters can be supplied including:
- skuId
- quantity
- priceOrder
You must provide a skuId OR product options. Product options can be posted as form or querystring parameters.
You must pass in the ProductOption attributeName as the key and the
ProductOptionValue attributeValue as the value. See CatalogEndpoint.
- Parameters:
request - uriInfo - categoryId - productId - skuId - quantity - priceOrder -
- Returns:
- OrderWrapper
removeItemFromOrder
public OrderWrapper removeItemFromOrder(@Context
javax.servlet.http.HttpServletRequest request,
Long itemId,
boolean priceOrder)
updateItemQuantity
public OrderWrapper updateItemQuantity(@Context
javax.servlet.http.HttpServletRequest request,
Long itemId,
Integer quantity,
boolean priceOrder)
addOfferCode
public OrderWrapper addOfferCode(@Context
javax.servlet.http.HttpServletRequest request,
String promoCode,
boolean priceOrder)
removeOfferCode
public OrderWrapper removeOfferCode(@Context
javax.servlet.http.HttpServletRequest request,
String promoCode,
boolean priceOrder)
removeAllOfferCodes
public OrderWrapper removeAllOfferCodes(@Context
javax.servlet.http.HttpServletRequest request,
boolean priceOrder)
Copyright © 2012. All Rights Reserved.