com.elasticpath.service.shoppingcart.impl
Class CheckoutServiceImpl

java.lang.Object
  extended by com.elasticpath.service.impl.AbstractEpServiceImpl
      extended by com.elasticpath.service.shoppingcart.impl.CheckoutServiceImpl
All Implemented Interfaces:
EpService, CheckoutService

public class CheckoutServiceImpl
extends AbstractEpServiceImpl
implements CheckoutService

Provides a service to execute a shopping cart checkout.


Constructor Summary
CheckoutServiceImpl()
           
 
Method Summary
 void calculateTaxAndBeforeTaxValue(ShoppingCart shoppingCart)
          Complete the tax related calculation for the given shoppingCart.
 void checkout(ShoppingCart shoppingCart, OrderPayment orderPayment)
          Processes an order for the items in the specified shopping cart.
 void retrieveShippingOption(ShoppingCart shoppingCart)
          Retrieve the valid shippingServiceLevels based on the given shoppingCart, and set the first one of the valid shippingServiceLevels as the selected shipping option by default.
 void setCheckoutEventHandler(CheckoutEventHandler checkoutEventHandler)
          Set the handler to be notified of checkout events.
 void setCustomerService(CustomerService customerService)
          Set the customer service.
 void setCustomerSessionService(CustomerSessionService customerSessionService)
          Set the customer session service.
 void setEmailService(EmailService emailService)
          Set the emailService.
 void setInventoryService(InventoryService inventoryService)
          Set the inventory service.
 void setOrderService(OrderService orderService)
          Set the order service.
 void setPaymentTypeFactory(PaymentTypeFactory paymentTypeFactory)
          Set the PaymentTypeFactory singleton.
 void setRuleService(RuleService ruleService)
          Set the rule service.
 void setShippingServiceLevelService(ShippingServiceLevelService shippingServiceLevelService)
          Set the shippingServiceLevel service.
 void setShoppingCartService(ShoppingCartService shoppingCartService)
          Set the shopping cart service.
 void setTaxJurisdictionService(TaxJurisdictionService taxJurisdictionService)
          Set the taxJurisdiction service.
 
Methods inherited from class com.elasticpath.service.impl.AbstractEpServiceImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.service.EpService
getElasticPath, setElasticPath
 

Constructor Detail

CheckoutServiceImpl

public CheckoutServiceImpl()
Method Detail

calculateTaxAndBeforeTaxValue

public void calculateTaxAndBeforeTaxValue(ShoppingCart shoppingCart)
Complete the tax related calculation for the given shoppingCart.

Specified by:
calculateTaxAndBeforeTaxValue in interface CheckoutService
Parameters:
shoppingCart - the current shopping cart.

checkout

public void checkout(ShoppingCart shoppingCart,
                     OrderPayment orderPayment)
Processes an order for the items in the specified shopping cart. This will create an order, update customer account information, and empty the shopping cart. This method currently requires that the order payment has been successfully processed.

Specified by:
checkout in interface CheckoutService
Parameters:
shoppingCart - the cart to checkout
orderPayment - the orderPayment representing the payment detail information. Javadoc tags not used due to a Checkstyle processing error: throws CardDeclinedException if the card is declined throws CardExpiredException if the card has expired throws CardErrorException if there was an error processing the given information throws EpServiceException if the payment processing fails throws InsufficientInventoryException if there is not enough inventory to complete the order

retrieveShippingOption

public void retrieveShippingOption(ShoppingCart shoppingCart)
Retrieve the valid shippingServiceLevels based on the given shoppingCart, and set the first one of the valid shippingServiceLevels as the selected shipping option by default.

Specified by:
retrieveShippingOption in interface CheckoutService
Parameters:
shoppingCart - the current shopping cart.

setCheckoutEventHandler

public void setCheckoutEventHandler(CheckoutEventHandler checkoutEventHandler)
Set the handler to be notified of checkout events.

Parameters:
checkoutEventHandler - the CheckoutEventHandler

setCustomerService

public void setCustomerService(CustomerService customerService)
Set the customer service.

Specified by:
setCustomerService in interface CheckoutService
Parameters:
customerService - the customer service.

setCustomerSessionService

public void setCustomerSessionService(CustomerSessionService customerSessionService)
Set the customer session service.

Parameters:
customerSessionService - the customer session service

setEmailService

public void setEmailService(EmailService emailService)
Set the emailService.

Parameters:
emailService - the emailService

setInventoryService

public void setInventoryService(InventoryService inventoryService)
Set the inventory service.

Parameters:
inventoryService - the inventory service

setOrderService

public void setOrderService(OrderService orderService)
Set the order service.

Specified by:
setOrderService in interface CheckoutService
Parameters:
orderService - the order service

setPaymentTypeFactory

public void setPaymentTypeFactory(PaymentTypeFactory paymentTypeFactory)
Set the PaymentTypeFactory singleton.

Parameters:
paymentTypeFactory - the paymentTypeFactory singleton.

setRuleService

public void setRuleService(RuleService ruleService)
Set the rule service.

Specified by:
setRuleService in interface CheckoutService
Parameters:
ruleService - the rule service

setShippingServiceLevelService

public void setShippingServiceLevelService(ShippingServiceLevelService shippingServiceLevelService)
Set the shippingServiceLevel service.

Specified by:
setShippingServiceLevelService in interface CheckoutService
Parameters:
shippingServiceLevelService - the shippingServiceLevel service.

setShoppingCartService

public void setShoppingCartService(ShoppingCartService shoppingCartService)
Set the shopping cart service.

Specified by:
setShoppingCartService in interface CheckoutService
Parameters:
shoppingCartService - the shopping cart service

setTaxJurisdictionService

public void setTaxJurisdictionService(TaxJurisdictionService taxJurisdictionService)
Set the taxJurisdiction service.

Specified by:
setTaxJurisdictionService in interface CheckoutService
Parameters:
taxJurisdictionService - the taxJurisdiction service