public class DefaultCheckoutController extends AbstractCallContextDependantController implements CheckoutController, CardPaymentController
CardPaymentController interface.| Modifier and Type | Class and Description |
|---|---|
protected static class |
DefaultCheckoutController.PaymentOption
Payment option used to return the data extracted from the payment form.
|
CONTROLLER_CONTEXT| Constructor and Description |
|---|
DefaultCheckoutController() |
| Modifier and Type | Method and Description |
|---|---|
void |
canCreatePayments()
Test if payment options can be created against the current cart.
|
protected ImpersonationContext |
createImpersonationContext(CartModel cartModel) |
protected DefaultCheckoutController.PaymentOption |
createPaymentOption() |
protected DefaultCheckoutController.PaymentOption |
createPaymentOptionFrom(ObjectValueContainer paymentOptionValueContainer) |
void |
dispatchEvent(java.lang.String context,
java.lang.Object source,
java.util.Map<java.lang.String,java.lang.Object> data)
Notifies all event acceptors which are registered for events with the context code context.
|
java.util.List<CreditCardType> |
getAvailableCartTypes()
The list of available card types
|
BasketController |
getBasketController()
Get the basket controller
|
protected CartModel |
getCartModel() |
CommerceCartService |
getCommerceCartService() |
protected CommonI18NService |
getCommonI18NService() |
protected CsCardPaymentService |
getCsCardPaymentService() |
protected CsCheckoutService |
getCsCheckoutService() |
TypedObject |
getCurrency()
Get the payment currency
|
CustomerController |
getCustomerController()
Get the customer controller
|
TypedObject |
getDefaultPaymentAddress()
Get the default payment address
|
java.util.Date |
getFirstAvailableNamedDeliveryDate(TypedObject cartEntry)
Get the first available named delivery date for the
|
protected ImpersonationService |
getImpersonationService() |
protected NamedDeliveryDateStrategy |
getNamedDeliveryDateStrategy() |
java.util.List<TypedObject> |
getPreviousPaymentInfos()
Get the list of available payment infos that can be used as templates for the card payment form.
|
double |
getSuggestedAmountForPaymentOption()
Get the outstanding payment amount.
|
java.util.List<TypedObject> |
getTokenisedCreditCards()
Gets the list of tokenised credit cards of this customer
|
java.util.List<TypedObject> |
getValidPaymentTransactions()
Get the valid payment transactions for the cart
|
boolean |
needPaymentOption()
Does the cart require further payment.
|
TypedObject |
placeOrder()
Place the order.
|
protected void |
populatePaymentOption(ObjectValueContainer paymentOptionValueContainer,
DefaultCheckoutController.PaymentOption paymentOption) |
boolean |
processPayment(ObjectValueContainer paymentOptionValueContainer)
Process the card payment
|
boolean |
processPayment(TypedObject tokenisedCreditCard,
java.math.BigDecimal amount,
java.lang.String cv2) |
protected void |
pushProperties(java.util.Map<java.lang.String,java.lang.Object> values,
java.lang.Object targetInstance) |
void |
setBasketController(BasketController basketController) |
void |
setCommerceCartService(CommerceCartService commerceCartService) |
void |
setCommonI18NService(CommonI18NService commonI18NService) |
void |
setCsCardPaymentService(CsCardPaymentService csCardPaymentService) |
void |
setCsCheckoutService(CsCheckoutService csCheckoutService) |
void |
setImpersonationService(ImpersonationService impersonationService) |
boolean |
setNamedDeliveryDate(TypedObject cartEntry,
java.util.Date date)
Set the named delivery date on a cart entry
|
void |
setNamedDeliveryDateStrategy(NamedDeliveryDateStrategy namedDeliveryDateStrategy) |
boolean |
splitCartEntry(TypedObject cartEntry)
Split a cart entry into 2 cart entries.
|
bindToCallContextController, getCallContextController, handleCallContextControllerEvent, setCallContextControllergetCockpitTypeService, getModelService, setCockpitTypeService, setModelServiceaddCockpitEventAcceptor, dispatchEvent, getAcceptors, removeCockpitEventAcceptor, setCockpitEventAcceptorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddCockpitEventAcceptor, removeCockpitEventAcceptor, setCockpitEventAcceptorsprotected CsCardPaymentService getCsCardPaymentService()
public void setCsCardPaymentService(CsCardPaymentService csCardPaymentService)
protected CsCheckoutService getCsCheckoutService()
public void setCsCheckoutService(CsCheckoutService csCheckoutService)
protected NamedDeliveryDateStrategy getNamedDeliveryDateStrategy()
public void setNamedDeliveryDateStrategy(NamedDeliveryDateStrategy namedDeliveryDateStrategy)
public CommerceCartService getCommerceCartService()
public void setCommerceCartService(CommerceCartService commerceCartService)
protected CommonI18NService getCommonI18NService()
public void setCommonI18NService(CommonI18NService commonI18NService)
protected ImpersonationService getImpersonationService()
public void setImpersonationService(ImpersonationService impersonationService)
public void dispatchEvent(java.lang.String context,
java.lang.Object source,
java.util.Map<java.lang.String,java.lang.Object> data)
WidgetControllerdispatchEvent in interface WidgetControllerdispatchEvent in class AbstractWidgetControllercontext - event contextsource - event sourcedata - parameters to be be passed to registered listenerspublic BasketController getBasketController()
CheckoutControllergetBasketController in interface CheckoutControllerpublic void setBasketController(BasketController basketController)
public CustomerController getCustomerController()
CardPaymentControllergetCustomerController in interface CardPaymentControllerpublic TypedObject placeOrder() throws ValidationException
CheckoutControllerplaceOrder in interface CheckoutControllerValidationException - thrown if the order fails validationprotected ImpersonationContext createImpersonationContext(CartModel cartModel)
protected CartModel getCartModel()
public boolean splitCartEntry(TypedObject cartEntry) throws InvalidCartException
CheckoutControllersplitCartEntry in interface CheckoutControllercartEntry - the cart entryInvalidCartException - thrown on errorpublic java.util.Date getFirstAvailableNamedDeliveryDate(TypedObject cartEntry)
CheckoutControllergetFirstAvailableNamedDeliveryDate in interface CheckoutControllercartEntry - the cart entrypublic boolean setNamedDeliveryDate(TypedObject cartEntry, java.util.Date date)
CheckoutControllersetNamedDeliveryDate in interface CheckoutControllercartEntry - the cart entrydate - the named delivery datepublic boolean needPaymentOption()
CheckoutControllerneedPaymentOption in interface CheckoutControllerpublic double getSuggestedAmountForPaymentOption()
CheckoutControllergetSuggestedAmountForPaymentOption in interface CardPaymentControllergetSuggestedAmountForPaymentOption in interface CheckoutControllerpublic java.util.List<TypedObject> getValidPaymentTransactions()
CheckoutControllergetValidPaymentTransactions in interface CheckoutControllerpublic void canCreatePayments()
throws ValidationException
CheckoutControllercanCreatePayments in interface CheckoutControllerValidationException - Exception thrown if payments cannot be created at this time. The exception includes messages that
detail the errors.public java.util.List<TypedObject> getTokenisedCreditCards()
CheckoutControllergetTokenisedCreditCards in interface CheckoutControllerpublic java.util.List<TypedObject> getPreviousPaymentInfos()
CardPaymentControllergetPreviousPaymentInfos in interface CardPaymentControllerpublic TypedObject getCurrency()
CardPaymentControllergetCurrency in interface CardPaymentControllerpublic TypedObject getDefaultPaymentAddress()
CardPaymentControllergetDefaultPaymentAddress in interface CardPaymentControllerpublic java.util.List<CreditCardType> getAvailableCartTypes()
CardPaymentControllergetAvailableCartTypes in interface CardPaymentControllerpublic boolean processPayment(ObjectValueContainer paymentOptionValueContainer) throws PaymentException, ValidationException
CardPaymentControllerprocessPayment in interface CardPaymentControllerpaymentOptionValueContainer - the payment dataPaymentException - thrown when payment service failsValidationException - thrown if the payment data is invalidpublic boolean processPayment(TypedObject tokenisedCreditCard, java.math.BigDecimal amount, java.lang.String cv2) throws PaymentException, ValidationException
processPayment in interface CheckoutControllertokenisedCreditCard - the stored cardamount - the amount to authorisecv2 - the cv2 numberPaymentException - thrown when payment service failsValidationException - thrown if the payment data is invalidprotected DefaultCheckoutController.PaymentOption createPaymentOptionFrom(ObjectValueContainer paymentOptionValueContainer)
protected DefaultCheckoutController.PaymentOption createPaymentOption()
protected void populatePaymentOption(ObjectValueContainer paymentOptionValueContainer, DefaultCheckoutController.PaymentOption paymentOption)
protected void pushProperties(java.util.Map<java.lang.String,java.lang.Object> values,
java.lang.Object targetInstance)
throws java.beans.IntrospectionException,
java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException
java.beans.IntrospectionExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessExceptionCopyright © 2018 SAP SE. All Rights Reserved.