Class CheckOutHelper
java.lang.Object
org.apache.ofbiz.order.shoppingcart.CheckOutHelper
A facade over the ShoppingCart to simplify the relatively complex
processing required to create an order in the system.
-
Constructor Summary
ConstructorDescriptionCheckOutHelper
(LocalDispatcher dispatcher, Delegator delegator, ShoppingCart cart) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
adjustFaceToFacePayment
(String orderId, BigDecimal cartTotal, List<GenericValue> allPaymentPrefs, GenericValue userLogin, Delegator delegator) availableAccountBalance
(String billingAccountId) Available account balance big decimal.static BigDecimal
availableAccountBalance
(String billingAccountId, LocalDispatcher dispatcher) void
Calc and add tax.void
calcAndAddTax
(boolean skipEmptyAddresses) Calc and add tax.void
calcAndAddTax
(GenericValue shipAddress) Calc and add tax.void
calcAndAddTax
(GenericValue shipAddress, boolean skipEmptyAddresses) Calc and add tax.checkExternalPayment
(String orderId) Check external payment map.Check gift card map.checkOrderDenylist
(GenericValue userLogin) Deprecated.Check order black list map.createOrder
(GenericValue userLogin) Create order map.createOrder
(GenericValue userLogin, String distributorId, String affiliateId, List<GenericValue> trackingCodeOrders, boolean areOrderItemsExploded, String visitId, String webSiteId) Create order event - uses createOrder service for processingfailedDenylistCheck
(GenericValue userLogin, GenericValue productStore) Failed denylist check map.finalizeOrderEntryOptions
(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String orderAdditionalEmails) Sets the options associated with the order for a given ship groupfinalizeOrderEntryOptions
(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String internalOrderNotes, String shippingNotes) Finalize order entry options map.finalizeOrderEntryOptions
(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String internalOrderNotes, String shippingNotes, BigDecimal shipEstimate) Finalize order entry options map.finalizeOrderEntryPayment
(String checkOutPaymentId, BigDecimal amount, boolean singleUse, boolean append) Sets the payment ID to use during the checkout processfinalizeOrderEntryShip
(int shipGroupIndex, String shippingContactMechId, String supplierPartyId, String supplierAgreementId) Sets the shipping contact mechanism for a given ship group on the cartmakeBillingAccountMap
(List<GenericValue> paymentPrefs) Make billing account map map.processPayment
(String orderId, BigDecimal orderTotal, String currencyUomId, GenericValue productStore, GenericValue userLogin, boolean faceToFace, boolean manualHold, LocalDispatcher dispatcher, Delegator delegator) processPayment
(GenericValue productStore, GenericValue userLogin) Process payment map.processPayment
(GenericValue productStore, GenericValue userLogin, boolean faceToFace) Process payment map.processPayment
(GenericValue productStore, GenericValue userLogin, boolean faceToFace, boolean manualHold) Process payment map.setCheckOutDates
(Timestamp shipBefore, Timestamp shipAfter) Sets check out dates.setCheckOutOptions
(String shippingMethod, String shippingContactMechId, Map<String, Map<String, Object>> selectedPaymentMethods, List<String> singleUsePayments, String billingAccountId, String shippingInstructions, String orderAdditionalEmails, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate) Sets check out options.setCheckOutPayment
(Map<String, Map<String, Object>> selectedPaymentMethods, List<String> singleUsePayments, String billingAccountId) Sets check out payment.setCheckOutPaymentInternal
(Map<String, Map<String, Object>> selectedPaymentMethods, List<String> singleUsePayments, String billingAccountId) Sets check out payment internal.setCheckOutShippingAddress
(String shippingContactMechId) Sets check out shipping address.setCheckOutShippingOptions
(String shippingMethod, String shippingInstructions, String orderAdditionalEmails, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate) Sets check out shipping options.void
Validate gift card amounts.Validate payment methods map.
-
Constructor Details
-
CheckOutHelper
-
-
Method Details
-
setCheckOutShippingAddress
Sets check out shipping address.- Parameters:
shippingContactMechId
- the shipping contact mech id- Returns:
- the check out shipping address
-
setCheckOutShippingOptions
public Map<String,Object> setCheckOutShippingOptions(String shippingMethod, String shippingInstructions, String orderAdditionalEmails, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate) Sets check out shipping options.- Parameters:
shippingMethod
- the shipping methodshippingInstructions
- the shipping instructionsorderAdditionalEmails
- the order additional emailsmaySplit
- the may splitgiftMessage
- the gift messageisGift
- the is giftinternalCode
- the internal codeshipBeforeDate
- the ship before dateshipAfterDate
- the ship after date- Returns:
- the check out shipping options
-
setCheckOutPayment
public Map<String,Object> setCheckOutPayment(Map<String, Map<String, Object>> selectedPaymentMethods, List<String> singleUsePayments, String billingAccountId) Sets check out payment.- Parameters:
selectedPaymentMethods
- the selected payment methodssingleUsePayments
- the single use paymentsbillingAccountId
- the billing account id- Returns:
- the check out payment
-
setCheckOutPaymentInternal
public List<String> setCheckOutPaymentInternal(Map<String, Map<String, Object>> selectedPaymentMethods, List<String> singleUsePayments, String billingAccountId) Sets check out payment internal.- Parameters:
selectedPaymentMethods
- the selected payment methodssingleUsePayments
- the single use paymentsbillingAccountId
- the billing account id- Returns:
- the check out payment internal
-
setCheckOutDates
Sets check out dates.- Parameters:
shipBefore
- the ship beforeshipAfter
- the ship after- Returns:
- the check out dates
-
setCheckOutOptions
public Map<String,Object> setCheckOutOptions(String shippingMethod, String shippingContactMechId, Map<String, Map<String, Object>> selectedPaymentMethods, List<String> singleUsePayments, String billingAccountId, String shippingInstructions, String orderAdditionalEmails, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate) Sets check out options.- Parameters:
shippingMethod
- the shipping methodshippingContactMechId
- the shipping contact mech idselectedPaymentMethods
- the selected payment methodssingleUsePayments
- the single use paymentsbillingAccountId
- the billing account idshippingInstructions
- the shipping instructionsorderAdditionalEmails
- the order additional emailsmaySplit
- the may splitgiftMessage
- the gift messageisGift
- the is giftinternalCode
- the internal codeshipBeforeDate
- the ship before dateshipAfterDate
- the ship after date- Returns:
- the check out options
-
checkGiftCard
public Map<String,Object> checkGiftCard(Map<String, Object> params, Map<String, Map<String, Object>> selectedPaymentMethods) Check gift card map.- Parameters:
params
- the paramsselectedPaymentMethods
- the selected payment methods- Returns:
- the map
-
createOrder
Create order map.- Parameters:
userLogin
- the user login- Returns:
- the map
-
createOrder
public Map<String,Object> createOrder(GenericValue userLogin, String distributorId, String affiliateId, List<GenericValue> trackingCodeOrders, boolean areOrderItemsExploded, String visitId, String webSiteId) Create order event - uses createOrder service for processing- Parameters:
userLogin
- the user logindistributorId
- the distributor idaffiliateId
- the affiliate idtrackingCodeOrders
- the tracking code ordersareOrderItemsExploded
- the are order items explodedvisitId
- the visit idwebSiteId
- the web site id- Returns:
- the map
-
calcAndAddTax
Calc and add tax.- Throws:
GeneralException
- the general exception
-
calcAndAddTax
Calc and add tax.- Parameters:
skipEmptyAddresses
- the skip empty addresses- Throws:
GeneralException
- the general exception
-
calcAndAddTax
Calc and add tax.- Parameters:
shipAddress
- the ship address- Throws:
GeneralException
- the general exception
-
calcAndAddTax
public void calcAndAddTax(GenericValue shipAddress, boolean skipEmptyAddresses) throws GeneralException Calc and add tax.- Parameters:
shipAddress
- the ship addressskipEmptyAddresses
- the skip empty addresses- Throws:
GeneralException
- the general exception
-
processPayment
public Map<String,Object> processPayment(GenericValue productStore, GenericValue userLogin) throws GeneralException Process payment map.- Parameters:
productStore
- the product storeuserLogin
- the user login- Returns:
- the map
- Throws:
GeneralException
- the general exception
-
processPayment
public Map<String,Object> processPayment(GenericValue productStore, GenericValue userLogin, boolean faceToFace) throws GeneralException Process payment map.- Parameters:
productStore
- the product storeuserLogin
- the user loginfaceToFace
- the face to face- Returns:
- the map
- Throws:
GeneralException
- the general exception
-
processPayment
public Map<String,Object> processPayment(GenericValue productStore, GenericValue userLogin, boolean faceToFace, boolean manualHold) throws GeneralException Process payment map.- Parameters:
productStore
- the product storeuserLogin
- the user loginfaceToFace
- the face to facemanualHold
- the manual hold- Returns:
- the map
- Throws:
GeneralException
- the general exception
-
processPayment
public static Map<String,Object> processPayment(String orderId, BigDecimal orderTotal, String currencyUomId, GenericValue productStore, GenericValue userLogin, boolean faceToFace, boolean manualHold, LocalDispatcher dispatcher, Delegator delegator) throws GeneralException - Throws:
GeneralException
-
adjustFaceToFacePayment
public static void adjustFaceToFacePayment(String orderId, BigDecimal cartTotal, List<GenericValue> allPaymentPrefs, GenericValue userLogin, Delegator delegator) throws GeneralException - Throws:
GeneralException
-
checkOrderDenyList
Check order black list map.- Returns:
- the map
-
checkOrderDenylist
Deprecated.Check order denylist map.- Parameters:
userLogin
- the user login- Returns:
- the map
-
failedDenylistCheck
Failed denylist check map.- Parameters:
userLogin
- the user loginproductStore
- the product store- Returns:
- the map
-
checkExternalPayment
Check external payment map.- Parameters:
orderId
- the order id- Returns:
- the map
-
finalizeOrderEntryShip
public Map<String,Object> finalizeOrderEntryShip(int shipGroupIndex, String shippingContactMechId, String supplierPartyId, String supplierAgreementId) Sets the shipping contact mechanism for a given ship group on the cart- Parameters:
shipGroupIndex
- The index of the ship group in the cartshippingContactMechId
- The identifier of the contactsupplierPartyId
- The identifier of the supplier to use for the drop shipmentsupplierAgreementId
- The identifier of the agreement with the supplier- Returns:
- A Map conforming to the OFBiz Service conventions containing any error messages
-
finalizeOrderEntryOptions
public Map<String,Object> finalizeOrderEntryOptions(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String orderAdditionalEmails) Sets the options associated with the order for a given ship group- Parameters:
shipGroupIndex
- The index of the ship group in the cartshippingMethod
- The shipping method indicating the carrier and shipment type to useshippingInstructions
- Any additional handling instructionsmaySplit
- "true" or anything else forfalse
giftMessage
- A message to have included for the recipientisGift
- "true" or anything else forfalse
internalCode
- an internal code associated with the order- Returns:
- A Map conforming to the OFBiz Service conventions containing any error messages
-
finalizeOrderEntryOptions
public Map<String,Object> finalizeOrderEntryOptions(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String internalOrderNotes, String shippingNotes, BigDecimal shipEstimate) Finalize order entry options map.- Parameters:
shipGroupIndex
- the ship group indexshippingMethod
- the shipping methodshippingInstructions
- the shipping instructionsmaySplit
- the may splitgiftMessage
- the gift messageisGift
- the is giftinternalCode
- the internal codeshipBeforeDate
- the ship before dateshipAfterDate
- the ship after dateinternalOrderNotes
- the internal order notesshippingNotes
- the shipping notesshipEstimate
- the ship estimate- Returns:
- the map
-
finalizeOrderEntryOptions
public Map<String,Object> finalizeOrderEntryOptions(int shipGroupIndex, String shippingMethod, String shippingInstructions, String maySplit, String giftMessage, String isGift, String internalCode, String shipBeforeDate, String shipAfterDate, String internalOrderNotes, String shippingNotes) Finalize order entry options map.- Parameters:
shipGroupIndex
- the ship group indexshippingMethod
- the shipping methodshippingInstructions
- the shipping instructionsmaySplit
- the may splitgiftMessage
- the gift messageisGift
- the is giftinternalCode
- the internal codeshipBeforeDate
- the ship before dateshipAfterDate
- the ship after dateinternalOrderNotes
- the internal order notesshippingNotes
- the shipping notes- Returns:
- the map
-
finalizeOrderEntryPayment
public Map<String,Object> finalizeOrderEntryPayment(String checkOutPaymentId, BigDecimal amount, boolean singleUse, boolean append) Sets the payment ID to use during the checkout process- Parameters:
checkOutPaymentId
- The payment ID to be associated with the cart- Returns:
- A Map conforming to the OFBiz Service conventions containing any error messages.
-
availableAccountBalance
public static BigDecimal availableAccountBalance(String billingAccountId, LocalDispatcher dispatcher) -
availableAccountBalance
Available account balance big decimal.- Parameters:
billingAccountId
- the billing account id- Returns:
- the big decimal
-
makeBillingAccountMap
Make billing account map map.- Parameters:
paymentPrefs
- the payment prefs- Returns:
- the map
-
validatePaymentMethods
Validate payment methods map.- Returns:
- the map
-
validateGiftCardAmounts
public void validateGiftCardAmounts()Validate gift card amounts.
-