Class CheckOutHelper

java.lang.Object
org.apache.ofbiz.order.shoppingcart.CheckOutHelper

public class CheckOutHelper extends Object
A facade over the ShoppingCart to simplify the relatively complex processing required to create an order in the system.
  • Constructor Details

  • Method Details

    • setCheckOutShippingAddress

      public Map<String,Object> setCheckOutShippingAddress(String shippingContactMechId)
      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 method
      shippingInstructions - the shipping instructions
      orderAdditionalEmails - the order additional emails
      maySplit - the may split
      giftMessage - the gift message
      isGift - the is gift
      internalCode - the internal code
      shipBeforeDate - the ship before date
      shipAfterDate - 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 methods
      singleUsePayments - the single use payments
      billingAccountId - 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 methods
      singleUsePayments - the single use payments
      billingAccountId - the billing account id
      Returns:
      the check out payment internal
    • setCheckOutDates

      public Map<String,Object> setCheckOutDates(Timestamp shipBefore, Timestamp shipAfter)
      Sets check out dates.
      Parameters:
      shipBefore - the ship before
      shipAfter - 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 method
      shippingContactMechId - the shipping contact mech id
      selectedPaymentMethods - the selected payment methods
      singleUsePayments - the single use payments
      billingAccountId - the billing account id
      shippingInstructions - the shipping instructions
      orderAdditionalEmails - the order additional emails
      maySplit - the may split
      giftMessage - the gift message
      isGift - the is gift
      internalCode - the internal code
      shipBeforeDate - the ship before date
      shipAfterDate - 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 params
      selectedPaymentMethods - the selected payment methods
      Returns:
      the map
    • createOrder

      public Map<String,Object> createOrder(GenericValue userLogin)
      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 login
      distributorId - the distributor id
      affiliateId - the affiliate id
      trackingCodeOrders - the tracking code orders
      areOrderItemsExploded - the are order items exploded
      visitId - the visit id
      webSiteId - the web site id
      Returns:
      the map
    • calcAndAddTax

      public void calcAndAddTax() throws GeneralException
      Calc and add tax.
      Throws:
      GeneralException - the general exception
    • calcAndAddTax

      public void calcAndAddTax(boolean skipEmptyAddresses) throws GeneralException
      Calc and add tax.
      Parameters:
      skipEmptyAddresses - the skip empty addresses
      Throws:
      GeneralException - the general exception
    • calcAndAddTax

      public void calcAndAddTax(GenericValue shipAddress) throws GeneralException
      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 address
      skipEmptyAddresses - 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 store
      userLogin - 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 store
      userLogin - the user login
      faceToFace - 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 store
      userLogin - the user login
      faceToFace - the face to face
      manualHold - 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

      public Map<String,Object> checkOrderDenyList()
      Check order black list map.
      Returns:
      the map
    • checkOrderDenylist

      @Deprecated public Map<String,Object> checkOrderDenylist(GenericValue userLogin)
      Deprecated.
      Check order denylist map.
      Parameters:
      userLogin - the user login
      Returns:
      the map
    • failedDenylistCheck

      public Map<String,Object> failedDenylistCheck(GenericValue userLogin, GenericValue productStore)
      Failed denylist check map.
      Parameters:
      userLogin - the user login
      productStore - the product store
      Returns:
      the map
    • checkExternalPayment

      public Map<String,Object> checkExternalPayment(String orderId)
      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 cart
      shippingContactMechId - The identifier of the contact
      supplierPartyId - The identifier of the supplier to use for the drop shipment
      supplierAgreementId - 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 cart
      shippingMethod - The shipping method indicating the carrier and shipment type to use
      shippingInstructions - Any additional handling instructions
      maySplit - "true" or anything else for false
      giftMessage - A message to have included for the recipient
      isGift - "true" or anything else for false
      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 index
      shippingMethod - the shipping method
      shippingInstructions - the shipping instructions
      maySplit - the may split
      giftMessage - the gift message
      isGift - the is gift
      internalCode - the internal code
      shipBeforeDate - the ship before date
      shipAfterDate - the ship after date
      internalOrderNotes - the internal order notes
      shippingNotes - the shipping notes
      shipEstimate - 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 index
      shippingMethod - the shipping method
      shippingInstructions - the shipping instructions
      maySplit - the may split
      giftMessage - the gift message
      isGift - the is gift
      internalCode - the internal code
      shipBeforeDate - the ship before date
      shipAfterDate - the ship after date
      internalOrderNotes - the internal order notes
      shippingNotes - 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

      public BigDecimal availableAccountBalance(String billingAccountId)
      Available account balance big decimal.
      Parameters:
      billingAccountId - the billing account id
      Returns:
      the big decimal
    • makeBillingAccountMap

      public Map<String,BigDecimal> makeBillingAccountMap(List<GenericValue> paymentPrefs)
      Make billing account map map.
      Parameters:
      paymentPrefs - the payment prefs
      Returns:
      the map
    • validatePaymentMethods

      public Map<String,Object> validatePaymentMethods()
      Validate payment methods map.
      Returns:
      the map
    • validateGiftCardAmounts

      public void validateGiftCardAmounts()
      Validate gift card amounts.