O
- as Order
public class OrderProcessHelper<O extends Order<?>> extends Object implements Strategy
#validatePaymentMethod(Order, PaymentMethod, Form, MarkupContainer)
Constructor and Description |
---|
OrderProcessHelper() |
OrderProcessHelper(OrderStrategy orderStrategy,
OrderService orderService,
EcomUserDaoImpl<GuestUser> userDao) |
OrderProcessHelper(OrderStrategy orderStrategy,
OrderService orderService,
PaymentOptionsStrategy paymentOptionsStrategy,
EcomUserDaoImpl<GuestUser> userDao) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowReuseOfOrder(IGenericEcomUser user,
O order)
Ensure Order via param injection is valid and secure to re-use
|
boolean |
allowReuseOfOrder(O order)
Ensure Order via param injection is valid and secure to re-use
|
<CONTEXT> CONTEXT |
deriveContext(IGenericEcomUser user,
org.apache.wicket.RequestCycle requestCycle)
Derive the Context from the session
Example : Other aspects maybe added to session; like couponCode etc in JSON.
|
<P extends Product> |
deriveOrder(Map<P,Number> productQuantityMap,
IGenericEcomUser user,
String currency,
Class<org.apache.wicket.Page> pageClass,
O existingOrderObject,
String orderId,
Map itemProperties,
boolean persist,
org.apache.commons.collections.Transformer transformer,
org.apache.wicket.RequestCycle requestCycle,
org.apache.wicket.Response response)
Derive an order object
THIS METHOD IS A HELPER, IT WILL NOT FILL ALL DETAILS LIKE PROMOTIONS, OrderItem specific additional properties etc. |
<P extends Product> |
deriveOrder(Map<P,Number> productQuantityMap,
IGenericEcomUser user,
String currency,
Class<org.apache.wicket.Page> pageClass,
O existingOrderObject,
String orderId,
Map itemProperties,
org.apache.wicket.RequestCycle requestCycle,
org.apache.wicket.Response response)
Derive a persistent created or create a persistent order
THIS METHOD IS A HELPER, IT WILL NOT FILL ALL DETAILS LIKE PROMOTIONS, OrderItem specific additional properties etc. |
String |
generatePaymentLink(O order)
Generate the purchase order link for the customer using the instance set
urlGenerator |
String |
generatePaymentLink(String baseCheckOutPageAddresss,
String userId,
String orderId,
String salt)
Deprecated.
|
ContextProviderStrategy |
getContextProviderStrategy() |
OrderService |
getOrderService() |
OrderStrategy |
getOrderStrategy() |
PaymentOptionsStrategy |
getPaymentOptionsStrategy() |
OrderURLGeneratorTransformer<O> |
getUrlGenerator() |
EcomUserDaoImpl<GuestUser> |
getUserDao() |
String |
getVersion()
Strategies change; it may be important/required in most applications to know a result based on which version of a particular strategy.
|
void |
setContextProviderStrategy(ContextProviderStrategy contextProviderStrategy) |
void |
setOrderService(OrderService orderService) |
void |
setOrderStrategy(OrderStrategy orderStrategy) |
void |
setPaymentOptionsStrategy(PaymentOptionsStrategy paymentOptionsStrategy) |
void |
setUrlGenerator(OrderURLGeneratorTransformer<O> urlGenerator) |
void |
setUserDao(EcomUserDaoImpl<GuestUser> userDao) |
boolean |
validatePaymentMethod(O order,
org.apache.wicket.MarkupContainer feedbackPanel,
org.apache.wicket.MarkupContainer resourceContainer)
The container component calling this stateless-instance must also include the following Message container resources:
error.paymentmethod.invalid
error.order.nopaymentmethods
|
public OrderProcessHelper()
public OrderProcessHelper(OrderStrategy orderStrategy, OrderService orderService, PaymentOptionsStrategy paymentOptionsStrategy, EcomUserDaoImpl<GuestUser> userDao)
public OrderProcessHelper(OrderStrategy orderStrategy, OrderService orderService, EcomUserDaoImpl<GuestUser> userDao)
public boolean validatePaymentMethod(O order, org.apache.wicket.MarkupContainer feedbackPanel, org.apache.wicket.MarkupContainer resourceContainer) throws Exception
order
- as OpaymentMethod
- as PaymentMethod
feedbackPanel
- as MarkupContainer
like a form or container that displays error and feedback messagesresourceContainer
- as MarkupContainer
calling this method and containing the error message resourcesException
public <CONTEXT> CONTEXT deriveContext(IGenericEcomUser user, org.apache.wicket.RequestCycle requestCycle)
user
- as GenericEcomUser
requestCycle
- as RequestCycle
ContentProviderStrategy
public <P extends Product> O deriveOrder(Map<P,Number> productQuantityMap, IGenericEcomUser user, String currency, Class<org.apache.wicket.Page> pageClass, O existingOrderObject, String orderId, Map itemProperties, org.apache.wicket.RequestCycle requestCycle, org.apache.wicket.Response response) throws OrderPlacementException
OrderItem
specific additional properties etc.productQuantityMap
- as Map
of Product and the number items for the productuser
- as GenericEcomUser
making the orderpageClass
- @nullable true; if not null, it will redirect page to the pageClass with oid=order_idexistingOrderObject
- as Order
@nullable true; any Order object that already exists and needs tobe used instead of generating a new oneorderId
- as String (but expected number format) - Passed Paremter if existingOrderObject is not to be considered (dont care) and we want to use the parameter to derive the Order objectMap
- itemProperties - Map of Product Name to a Map (JSON) of associated properties for it.Order
; may or may not be the same as existingOrderObjectOrderPlacementException
public <P extends Product> O deriveOrder(Map<P,Number> productQuantityMap, IGenericEcomUser user, String currency, Class<org.apache.wicket.Page> pageClass, O existingOrderObject, String orderId, Map itemProperties, boolean persist, org.apache.commons.collections.Transformer transformer, org.apache.wicket.RequestCycle requestCycle, org.apache.wicket.Response response) throws OrderPlacementException
OrderItem
specific additional properties etc.productQuantityMap
- as Map
of Product and the number items for the productuser
- as GenericEcomUser
making the orderpageClass
- @nullable true; if not null, it will redirect page to the pageClass with oid=order_idexistingOrderObject
- as Order
@nullable true; any Order object that already exists and needs tobe used instead of generating a new oneorderId
- as String (but expected number format) - Passed Paremter if existingOrderObject is not to be considered (dont care) and we want to use the parameter to derive the Order objectMap
- itemProperties - Map of Product Name to a Map (JSON) of associated properties for it.persist
- as boolean.transformer
- as Transformer (Optional), to perform any additional transformation over the in process Order Object before its persisted @nullable trueOrder
; may or may not be the same as existingOrderObjectOrderPlacementException
public boolean allowReuseOfOrder(IGenericEcomUser user, O order)
user
- as GenericEcomUser
order
- as Orderpublic boolean allowReuseOfOrder(O order)
order
- as Order@Deprecated public String generatePaymentLink(String baseCheckOutPageAddresss, String userId, String orderId, String salt)
generatePaymentLink(Order)
baseCheckOutPageAddresss
- as page base URLuserId
- as GenericEcomUser
orderId
- as Order
salt
- as String (optional security code)public String generatePaymentLink(O order)
urlGenerator
order
- as Opublic OrderStrategy getOrderStrategy()
public void setOrderStrategy(OrderStrategy orderStrategy)
public OrderService getOrderService()
public void setOrderService(OrderService orderService)
public PaymentOptionsStrategy getPaymentOptionsStrategy()
public void setPaymentOptionsStrategy(PaymentOptionsStrategy paymentOptionsStrategy)
public EcomUserDaoImpl<GuestUser> getUserDao()
public void setUserDao(EcomUserDaoImpl<GuestUser> userDao)
public ContextProviderStrategy getContextProviderStrategy()
public void setContextProviderStrategy(ContextProviderStrategy contextProviderStrategy)
public OrderURLGeneratorTransformer<O> getUrlGenerator()
public void setUrlGenerator(OrderURLGeneratorTransformer<O> urlGenerator)
public String getVersion()
getVersion
in interface Strategy
Copyright © 2018. All rights reserved.