Package com.skava.oms.orchestration.util
Class OrderUtils
java.lang.Object
com.skava.oms.orchestration.util.OrderUtils
The Class CartUtils.
This class is used for handling common cart related functionality- Author:
- Infosys Equinox
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkZeroCheckoutOrder
(String enableZeroCheckout, BigDecimal price) checkZeroCheckoutOrderstatic String
getZeroCheckoutProperty
(org.apache.camel.Exchange exchange) getZeroCheckoutPropertystatic boolean
isZeroCartOrder
(String enableZeroCheckout, SFCart sfCart) This method is used to check if storeProperty enableZeroCheckout is true and cart total is zerostatic boolean
isZeroPaymentOrder
(org.apache.camel.Exchange exchange, BigDecimal price) This method is used to check if storeProperty enableZeroCheckout is true and payment is zerosetPaymentForFullDiscountItem
(Math itemMath, List<Payment> nonCashPayments, List<Payment> cashPayments) This method is used to set the payment for the item with full discounts or totalSale is zero.setPaymentIdForShipping
(Math orderShippingItemMath, List<Payment> nonCashPayments) This method is to set paymentId for shippingstatic void
updateCreateOrderRequestDetails
(org.apache.camel.Exchange exchange, Order orderOms) updateCreateOrderRequestDetailsstatic void
updateOrderInfos
(Order order, SFCart sfCart, org.apache.camel.Exchange exchange, boolean csrOrder) This method is used to update ordered information based on the store id from the cart responsestatic void
updatePaymentBalanceMap
(Map<String, BigDecimal> paymentBalanceMap, BigDecimal totalSaleWithTax, Payment cashPayment, PaymentItem paymentItem, BigDecimal value, String isB2B2C) This method is to update payment balance map based on payment type.
-
Method Details
-
updateOrderInfos
public static void updateOrderInfos(Order order, SFCart sfCart, org.apache.camel.Exchange exchange, boolean csrOrder) This method is used to update ordered information based on the store id from the cart response -
updateCreateOrderRequestDetails
public static void updateCreateOrderRequestDetails(org.apache.camel.Exchange exchange, Order orderOms) updateCreateOrderRequestDetails- Parameters:
exchange
- exchangeorderOms
- orderOms
-
isZeroCartOrder
This method is used to check if storeProperty enableZeroCheckout is true and cart total is zero- Parameters:
enableZeroCheckout
- Indicates the Zero checkout property valuesfCart
- Indicates aSFCart
, contains the entire cart of the customer- Returns:
- true or false
-
isZeroPaymentOrder
This method is used to check if storeProperty enableZeroCheckout is true and payment is zero- Parameters:
exchange
- Indicates aExchange
instance, which holds the information during the entire routing of a Message received by a Consumer.price
- Indicates the price value- Returns:
- true or false
-
checkZeroCheckoutOrder
checkZeroCheckoutOrder
This method is used to check the eligibility for zero checkout
- Parameters:
enableZeroCheckout
- Indicates the Zero checkout property valueprice
- Indicates the price value- Returns:
- true or false
-
getZeroCheckoutProperty
getZeroCheckoutProperty
This method is used to get ZeroCheckout store Property
- Parameters:
exchange
- Indicates aExchange
instance, which holds the information during the entire routing of a Message received by a Consumer.- Returns:
- enableZeroCheckout String value
-
setPaymentIdForShipping
public static List<Math> setPaymentIdForShipping(Math orderShippingItemMath, List<Payment> nonCashPayments) This method is to set paymentId for shipping- Parameters:
orderShippingItemMath
- Indicates the Math valuenonCashPayments
- Indicates a list of Payment information- Returns:
- List of Math information
-
setPaymentForFullDiscountItem
public static List<Math> setPaymentForFullDiscountItem(Math itemMath, List<Payment> nonCashPayments, List<Payment> cashPayments) This method is used to set the payment for the item with full discounts or totalSale is zero.- Parameters:
itemMath
- indicates the math of the itemnonCashPayments
- indicates the list of non-cash payments.cashPayments
- indicated the list of cash payments.- Returns:
- List of Math information
-
updatePaymentBalanceMap
public static void updatePaymentBalanceMap(Map<String, BigDecimal> paymentBalanceMap, BigDecimal totalSaleWithTax, Payment cashPayment, PaymentItem paymentItem, BigDecimal value, String isB2B2C) This method is to update payment balance map based on payment type.- Parameters:
paymentBalanceMap
- Indicates the payment balance map informationtotalSaleWithTax
- Indicates the total sale value with taxcashPayment
- Indicates the cash payment informationpaymentItem
- Indicates the Payment item informationvalue
- Indicates the payment valueisB2B2C
- isB2B2C
-