public class OnePageCheckoutProcessor
extends org.thymeleaf.processor.element.AbstractLocalVariableDefinitionElementProcessor
This is a Thymeleaf Processor that aids in rendering a dynamic One Page Checkout screen. These sections are driven by the state of the order and whether or not certain integrated payment modules are enabled (e.g. PayPal Express Review Page etc...).
For example, if there are no shippable fulfillment groups on the order, then the shipping section should not be shown. Or, if the user is redirected back from a Third Party Payment gateway to complete the order (e.g. PayPal Express Checkout), then the billing section will not be shown.
| Modifier and Type | Field and Description |
|---|---|
protected CountryService |
countryService |
protected CustomerAddressService |
customerAddressService |
protected FulfillmentGroupService |
fulfillmentGroupService |
protected FulfillmentOptionService |
fulfillmentOptionService |
protected FulfillmentPricingService |
fulfillmentPricingService |
protected OrderToPaymentRequestDTOService |
orderToPaymentRequestDTOService |
protected StateService |
stateService |
| Constructor and Description |
|---|
OnePageCheckoutProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
calculateNumShippableFulfillmentGroups() |
protected Map<String,Object> |
getNewLocalVariables(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element) |
int |
getPrecedence() |
protected boolean |
hasPopulatedBillingAddress(Order cart)
A helper method used to determine the validity of the payments on the Order
|
protected boolean |
hasPopulatedOrderInfo(Order cart)
A helper method used to determine the validity of order info
|
protected boolean |
hasPopulatedShippingAddress(Order cart)
A helper method used to determine the validity of the fulfillment groups
|
protected List<String> |
populateExpirationMonths()
A helper method used to construct a list of Credit Card Expiration Months
Useful for expiration dropdown menus.
|
protected List<String> |
populateExpirationYears()
A helper method used to construct a list of Credit Card Expiration Years
Useful for expiration dropdown menus.
|
protected void |
populateFulfillmentOptionsAndEstimationOnModel(Map<String,Object> localVars)
A helper method to retrieve all fulfillment options for the cart and estimate the cost of applying
fulfillment options on the first shippable fulfillment group.
|
protected void |
populateProcessingError(Map<String,Object> localVars)
This method is responsible for populating any Payment Procecessing Errors that may have been put
as a Redirect Attribute when attempting to checkout.
|
protected void |
populateSectionViewStates(Map<String,Object> localVars)
This method is responsible of populating the variables necessary to draw the checkout page.
|
protected void |
prepopulateCheckoutForms(Order cart,
OrderInfoForm orderInfoForm,
ShippingInfoForm shippingForm,
BillingInfoForm billingForm)
The Checkout page for Heat Clinic will have the shipping information pre-populated
with an address if the fulfillment group has an address and fulfillment option
associated with it.
|
protected boolean |
removeHostElement(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element) |
processElementdoProcess, getMatcherprotected StateService stateService
protected CountryService countryService
protected CustomerAddressService customerAddressService
protected FulfillmentGroupService fulfillmentGroupService
protected FulfillmentOptionService fulfillmentOptionService
protected FulfillmentPricingService fulfillmentPricingService
protected OrderToPaymentRequestDTOService orderToPaymentRequestDTOService
public int getPrecedence()
getPrecedence in class org.thymeleaf.processor.AbstractProcessorprotected boolean removeHostElement(org.thymeleaf.Arguments arguments,
org.thymeleaf.dom.Element element)
removeHostElement in class org.thymeleaf.processor.element.AbstractLocalVariableDefinitionElementProcessorprotected Map<String,Object> getNewLocalVariables(org.thymeleaf.Arguments arguments, org.thymeleaf.dom.Element element)
getNewLocalVariables in class org.thymeleaf.processor.element.AbstractLocalVariableDefinitionElementProcessorprotected void prepopulateCheckoutForms(Order cart, OrderInfoForm orderInfoForm, ShippingInfoForm shippingForm, BillingInfoForm billingForm)
protected int calculateNumShippableFulfillmentGroups()
protected void populateProcessingError(Map<String,Object> localVars)
localVars - protected void populateSectionViewStates(Map<String,Object> localVars)
localVars - protected void populateFulfillmentOptionsAndEstimationOnModel(Map<String,Object> localVars)
protected boolean hasPopulatedOrderInfo(Order cart)
cart - protected boolean hasPopulatedBillingAddress(Order cart)
cart - protected boolean hasPopulatedShippingAddress(Order cart)
cart - protected List<String> populateExpirationMonths()
Copyright © 2015. All Rights Reserved.