atg.commerce.pricing
Class PricingServices

java.lang.Object
  extended by atg.commerce.pricing.PricingServices

public class PricingServices
extends java.lang.Object

Exposes pricing functionality for use in web services. There are three exposed methods: calculateOrderPrice - takes an orderId and a locale and returns an OrderPrice object corresponding to the order. calculateOrderPriceSummary - takes an orderId and a locale and returns an OrderPriceSummary object corresponding to the order. calculateItemPriceSummary - takes a sku Id, product Id, quantity profile Id, and locale and returns an ItemPriceSummary object corresponding to the given information. There are several private helper methods in this class that convert standard pricing objects (PricingAdjustment, OrderPriceInfo, etc.) into objects created specifically for webservices (PriceAdjustment, ShippingPriceSubtotal, etc.) that do not contain complex types. We need to do this because webservices does not support complex types at this time.

See Also:
PricingTools

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String INVALID_PRODUCT_ID
           
static java.lang.String INVALID_PROFILE_ID
           
static java.lang.String INVALID_SKU_ID
           
static java.lang.String NULL_SKU_AND_PRODUCT
           
 
Constructor Summary
PricingServices()
          Constructs an instanceof PricingServices
 
Method Summary
 ItemPriceSummary calculateItemPriceSummary(java.lang.String pSkuId, java.lang.String pProductId, long pQuantity, java.lang.String pProfileId, java.lang.String pLocale)
          This method takes an sku Id, product Id, quantity, profile Id, and a locale, and prices the item based on the information given.
 OrderPrice calculateOrderPrice(java.lang.String pOrderId, java.lang.String pLocale)
          This method takes an order Id and a locale, prices the order, creates and returns an OrderPrice object based on the information in the priced order.
 OrderPriceSummary calculateOrderPriceSummary(java.lang.String pOrderId, java.lang.String pLocale)
          This method takes an order Id and a locale, prices the order, creates and returns an OrderPriceSummary object based on the information in the priced order.
 PricingTools getPricingTools()
          the PricingTools object which performs the pricing operations
 void setPricingTools(PricingTools pPricingTools)
          the PricingTools object that performs the pricing operations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


NULL_SKU_AND_PRODUCT

public static final java.lang.String NULL_SKU_AND_PRODUCT
See Also:
Constant Field Values

INVALID_SKU_ID

public static final java.lang.String INVALID_SKU_ID
See Also:
Constant Field Values

INVALID_PRODUCT_ID

public static final java.lang.String INVALID_PRODUCT_ID
See Also:
Constant Field Values

INVALID_PROFILE_ID

public static final java.lang.String INVALID_PROFILE_ID
See Also:
Constant Field Values
Constructor Detail

PricingServices

public PricingServices()
Constructs an instanceof PricingServices

Method Detail

setPricingTools

public void setPricingTools(PricingTools pPricingTools)
the PricingTools object that performs the pricing operations

Parameters:
pPricingTools - new value to set

getPricingTools

public PricingTools getPricingTools()
the PricingTools object which performs the pricing operations

Returns:
property PricingTools

calculateOrderPrice

public OrderPrice calculateOrderPrice(java.lang.String pOrderId,
                                      java.lang.String pLocale)
                               throws PricingException
This method takes an order Id and a locale, prices the order, creates and returns an OrderPrice object based on the information in the priced order.

Parameters:
pOrderId - the Id of the order to be priced
pLocale - String representing the locale to be considered when pricing
Returns:
OrderPrice an object containing the price information for the given order
Throws:
PricingException - if bad information is passed in, or there are errors in the pricing of the order

calculateOrderPriceSummary

public OrderPriceSummary calculateOrderPriceSummary(java.lang.String pOrderId,
                                                    java.lang.String pLocale)
                                             throws PricingException
This method takes an order Id and a locale, prices the order, creates and returns an OrderPriceSummary object based on the information in the priced order.

Parameters:
pOrderId - the Id of the order to be priced
pLocale - String representing the locale to be considered when pricing
Returns:
OrderPriceSummary an object containing the price information for the given order
Throws:
PricingException - if bad information is passed in, or there are errors in the pricing of the order

calculateItemPriceSummary

public ItemPriceSummary calculateItemPriceSummary(java.lang.String pSkuId,
                                                  java.lang.String pProductId,
                                                  long pQuantity,
                                                  java.lang.String pProfileId,
                                                  java.lang.String pLocale)
                                           throws PricingException
This method takes an sku Id, product Id, quantity, profile Id, and a locale, and prices the item based on the information given. The information is returned in an ItemPriceSummary object

Parameters:
pSkuId - the sku Id of the item to be priced
pProductId - the product Id of the item to be priced
pQuantity - the quantity of the item to be considered when pricing
pProfileId - the id of the profile to be considered when pricing
pLocale - String representing the locale to be considered when pricing
Returns:
ItemPriceSummary an object containing the price information for the given item
Throws:
PricingException - if bad information is passed in, or there are errors in the pricing of the item