atg.projects.store.order.purchase
Class StoreBillingProcessHelper

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.commerce.order.purchase.PurchaseProcessHelper
              extended by atg.projects.store.order.purchase.StorePurchaseProcessHelper
                  extended by atg.projects.store.order.purchase.StoreBillingProcessHelper
All Implemented Interfaces:
atg.naming.AbsoluteNameable, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameContextParentable, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.Configured, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class StoreBillingProcessHelper
extends StorePurchaseProcessHelper

Store implementation of the purchase process helper for billing sub-process.

Version:
$Id: //hosting-blueprint/B2CBlueprint/version/10.2.1/EStore/src/atg/projects/store/order/purchase/StoreBillingProcessHelper.java#5 $$Change: 796011 $
Author:
ATG

Field Summary
static java.lang.String AMOUNT_AUTHORIZED_PROP_NAME
           
static java.lang.String AMOUNT_REMAINING_PROP_NAME
           
static java.lang.String CLASS_VERSION
          Class version string.
protected static java.lang.String MSG_DUPLICATE_CC_NICKNAME
          Duplicate CC nickname message key.
protected static java.lang.String MSG_MISSING_REQUIRED_ADDRESS_PROPERTY
          Missing required address property.
protected static java.lang.String MSG_NICKNAME_WRONG_LENGTH
          Wrong nickname length message key.
protected static java.lang.String NEW_ADDRESS
          New address constant.
protected static java.lang.String NEW_CREDIT_CARD
          New credit card constant.
protected static java.lang.String ONLINE_CREDIT_INSUFFICIENT
          Online credit insufficient.
protected static java.lang.String SC_PAYMENT_GROUP_TYPE_NAME
          Store Credit payment group type name.
protected static java.lang.String STORE_CREDIT_ERROR
          Store credit payment group error message key.
protected static java.lang.String VERIFICATION_NUMBER_INVALID
          Invalid verification number message key.
 
Fields inherited from class atg.projects.store.order.purchase.StorePurchaseProcessHelper
ADDRESS_PROP_NAME, CITY_PROP_NAME, COUNTRY_PROP_NAME, FIRST_NAME_PROP_NAME, LAST_NAME_PROP_NAME, MSG_MULTIPLE_COUPONS_PER_ORDER, MSG_UNCLAIMABLE_COUPON, POSTAL_CODE_PROP_NAME, PRICING_ERROR, PRICING_ERROR_ADDRESS, STATE_PROP_NAME
 
Fields inherited from class atg.commerce.order.purchase.PurchaseProcessHelper
ERROR_FETCHING_PROFILE, MSG_ERROR_ADDING_CREDIT_CARD, MSG_ERROR_ADDING_SHIPPINGGROUP, MSG_ERROR_ADDING_TO_ORDER, MSG_ERROR_CHANGING_ITEM_QUANTITY, MSG_ERROR_CREATING_ORDER, MSG_ERROR_MOVING_ITEM_BETWEEN_SHIPPING_GROUPS, MSG_ERROR_PROCESS_ADD_ITEM_CHAIN, MSG_ERROR_REMOVING_ITEM, MSG_ERROR_REMOVING_ITEM_FROM_SHIPPING_GROUP, MSG_ERROR_REPRICING_ORDER_AFTER_ADD_ITEM, MSG_ERROR_SETTING_ORDER_AMOUNT, MSG_INVALID_PROFILE_ID
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
StoreBillingProcessHelper()
           
 
Method Summary
protected  void addBillingAddressToCard(atg.commerce.order.CreditCard pCard, boolean pUsingStoredAddress, java.lang.String pStoredAddressSelection, atg.repository.RepositoryItem pProfile, atg.commerce.order.Order pOrder)
          This method checks to see if the user chose a profile address.
 void addCreditCardAuthorizationNumber(atg.commerce.order.Order pOrder, java.lang.String pCreditCardVerificationNumber)
          Add Credit Card Verification Number to the CreditCard Payment Group.
 void addCreditCardDetails(atg.commerce.order.CreditCard pCreditCard, boolean pUsingStoredCreditCard, java.lang.String pStoredCreditCardName, atg.repository.RepositoryItem pProfile, java.util.Locale pUserLocale)
          Copy credit card from profile to order if paying with profile credit card.
 void addOrderAmountRemainingToCreditPaymentGroup(atg.commerce.order.Order pOrder)
          Added Remaining Order Amount relationship To Credit Card PaymentGroup.
protected  void copyCreditCardFromProfile(atg.commerce.order.CreditCard pCreditCard, java.lang.String pNickname, atg.repository.RepositoryItem pProfile, java.util.Locale pUserLocale)
          Utility method to copy credit card from profile to order.
 atg.commerce.order.CreditCard getCreditCard(atg.commerce.order.Order pOrder)
          Utility method to fetch credit card and set properties from page.
 double getOrderRemaningAmount(atg.commerce.order.Order pOrder)
          Get the remaining Amount from the order.
 atg.commerce.order.PaymentGroupManager getPaymentGroupManager()
          Return the PaymentGroupManager property.
protected  java.util.ResourceBundle getResourceBundle()
           
protected  java.lang.String getResourceBundleName()
           
 atg.commerce.order.purchase.ShippingGroupContainerService getShippingGroupContainerService()
           
 java.lang.String[] getStoreCreditIds(atg.repository.RepositoryItem pProfile)
          This method returns store credits that for the given profile that can be used for the order.
protected  boolean initializePaymentGroups(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pProfile, java.lang.String[] pOnlineCreditIds)
          Initializes the store credit payment method(s) based on the store credits the user chose.
protected  boolean isCreditCardEmpty(atg.commerce.order.CreditCard pCreditCard)
          Deprecated. this method has been moved to CommerceProfileTools.
protected  boolean isNewCreditCards(atg.commerce.order.Order pOrder)
           
protected  boolean isPayingWithOnlineCredit(java.lang.String[] pOnlineCreditIds)
          Checks to see if user is paying with a stored credit card.
 boolean isPaymentGroupOrderRelationShipExist(atg.commerce.order.PaymentGroup pPaymentGroup)
          Verify, whether Order Relationship exists in the given Payment Group or not.
 boolean isValidNickNameLength(java.lang.String pNickName, int pMinNickNameLength, int pMaxNickNameLength)
          Utility method to check if user's NickName meets the minimum and maximum length.
protected  void removeStoreCreditPaymentGroups(atg.commerce.order.Order pOrder)
          Remove any store credit payment groups from order.
protected  atg.service.pipeline.PipelineResult runProcessMoveToConfirmation(atg.commerce.order.Order pOrder, atg.commerce.pricing.PricingModelHolder pPricingModels, java.lang.String pMoveToConfirmationChainId, java.util.Locale pLocale, atg.repository.RepositoryItem pProfile, java.util.Map pExtraParameters)
          Run the pipeline which should be executed at the last of the billing process.
 void saveBillingAddressToProfile(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pProfile, java.lang.String pBillingAddressNickname)
          This method saves the Billing Address to the profile.
 void saveCreditCardToProfile(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pProfile, java.lang.String pCreditCardNickName)
          This method saves the credit card from the payment group to the profile.
 void saveDefaultBillingAddress(atg.repository.RepositoryItem pProfile, atg.commerce.order.CreditCard pCreditCard)
          Saves the address on the credit card to the user's default billing address.
 void setPaymentGroupManager(atg.commerce.order.PaymentGroupManager pPaymentGroupManager)
          Set the PaymentGroupManager property.
 void setShippingGroupContainerService(atg.commerce.order.purchase.ShippingGroupContainerService pShippingGroupContainerService)
           
 boolean setupCreditCardPaymentGroupsForOrder(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pProfile, boolean pUsingStoredCreditCard, java.lang.String pStoredCreditCardName, java.util.Locale pUserLocale)
          Added remaining order amount to the payment group for given pStoredCreditCardName.
 void setupStoreCreditPaymentGroupsForOrder(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pProfile, java.lang.String[] pOnlineCreditIds)
          Initialize Store Credit Payment Group, add amount to the payment group and add remainng amount to other payment groups CreditCard.
 boolean validateCreditCardAuthorizationNumber(java.lang.String pCreditCardVerificationNumber)
          Verify the Credit Card verification number.
 boolean validateCreditCardNicknameInput(atg.commerce.order.Order pOrder, atg.repository.RepositoryItem pProfile, java.lang.String pCreditCardNickname, int pMinNickNameLength, int pMaxNickNameLength)
          This method validates the credit card nickname if one is required.
protected  boolean validateCreditCardRequiredFields(atg.commerce.order.CreditCard card, java.lang.String pVerificationNumber, java.lang.String pNickname)
          Check required fields for the new credit card.
protected  double validateSufficientOnlineCredit(java.lang.String[] pOnlineCreditIds, atg.commerce.order.Order pOrder)
          This method verifies if the online credit(s) total is sufficient to cover the order total.
 
Methods inherited from class atg.projects.store.order.purchase.StorePurchaseProcessHelper
checkForRequiredAddressProperties, claimCoupon, claimCoupon, getAddressPropertyNameMap, getClaimableManager, getMandatoryStateCountryList, getPlaceUtils, getPricingTools, getRequiredAddressPropertyNames, getStoreConfiguration, getStoreOrderTools, removeCoupon, removeCoupon, repriceOrder, setAddressPropertyNameMap, setClaimableManager, setPlaceUtils, setPricingTools, setRequiredAddressPropertyNames, setStoreConfiguration, setStoreOrderTools, tenderCoupon
 
Methods inherited from class atg.commerce.order.purchase.PurchaseProcessHelper
addCreditCardToOrder, addItemsToOrder, addItemsToOrder, addItemToOrder, addItemToShippingGroup, addShippingAddressToOrder, adjustItemRelationshipsForQuantityChange, adjustNonGiftHandlingInstructionsForQuantityDecrease, adjustNonGiftHandlingInstructionsForQuantityIncrease, applyValueDictionary, changeItemQuantity, copyCreditCardInfo, createCommerceItem, createConfigurableSubitems, createOrder, decreaseRelationshipQuantity, deleteItem, deleteItems, deleteItems, getAddItemToOrderChainId, getAddItemToOrderPricingOp, getCommerceItemManager, getDefaultHardgoodShippingGroupType, getDeleteItemsFromOrderPricingOp, getFirstShippingGroup, getGiftlistManager, getOrderManager, getPipelineManager, getRepriceOrderChainId, getShippingGroupForItem, getShippingGroupManager, getTransactionManager, increaseRelationshipQuantity, isAddItemToDefaultShippingGroup, isTransactionMarkedAsRollBack, moveItemBetweenShippingGroups, postAddItemsToOrder, postDeleteItem, postDeleteItem, processGiftAddition, processPipelineErrors, removeEntireRelationshipQuantity, removeItemQuantityFromShippingGroup, runProcess, runProcess, runProcess, runProcessAddItemToOrder, runProcessRepriceOrder, runProcessSendScenarioEvent, runProcessSendScenarioEvent, runProcessSendScenarioEvent, runRepricingProcess, setAddItemToDefaultShippingGroup, setAddItemToOrderChainId, setAddItemToOrderPricingOp, setCommerceItemManager, setCommerceItemProperties, setDefaultHardgoodShippingGroupType, setDeleteItemsFromOrderPricingOp, setGiftlistManager, setOrderAmountToPaymentGroup, setOrderManager, setPipelineManager, setRepriceOrderChainId, setShippingGroupManager, setTransactionManager
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
Class version string.

See Also:
Constant Field Values

MSG_MISSING_REQUIRED_ADDRESS_PROPERTY

protected static final java.lang.String MSG_MISSING_REQUIRED_ADDRESS_PROPERTY
Missing required address property.

See Also:
Constant Field Values

MSG_NICKNAME_WRONG_LENGTH

protected static final java.lang.String MSG_NICKNAME_WRONG_LENGTH
Wrong nickname length message key.

See Also:
Constant Field Values

MSG_DUPLICATE_CC_NICKNAME

protected static final java.lang.String MSG_DUPLICATE_CC_NICKNAME
Duplicate CC nickname message key.

See Also:
Constant Field Values

SC_PAYMENT_GROUP_TYPE_NAME

protected static final java.lang.String SC_PAYMENT_GROUP_TYPE_NAME
Store Credit payment group type name.

See Also:
Constant Field Values

ONLINE_CREDIT_INSUFFICIENT

protected static final java.lang.String ONLINE_CREDIT_INSUFFICIENT
Online credit insufficient.

See Also:
Constant Field Values

STORE_CREDIT_ERROR

protected static final java.lang.String STORE_CREDIT_ERROR
Store credit payment group error message key.

See Also:
Constant Field Values

VERIFICATION_NUMBER_INVALID

protected static final java.lang.String VERIFICATION_NUMBER_INVALID
Invalid verification number message key.

See Also:
Constant Field Values

NEW_ADDRESS

protected static final java.lang.String NEW_ADDRESS
New address constant.

See Also:
Constant Field Values

NEW_CREDIT_CARD

protected static final java.lang.String NEW_CREDIT_CARD
New credit card constant.

See Also:
Constant Field Values

AMOUNT_REMAINING_PROP_NAME

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

AMOUNT_AUTHORIZED_PROP_NAME

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

StoreBillingProcessHelper

public StoreBillingProcessHelper()
Method Detail

setPaymentGroupManager

public void setPaymentGroupManager(atg.commerce.order.PaymentGroupManager pPaymentGroupManager)
Set the PaymentGroupManager property.

Parameters:
pPaymentGroupManager - a PaymentGroupManager value.

getPaymentGroupManager

public atg.commerce.order.PaymentGroupManager getPaymentGroupManager()
Return the PaymentGroupManager property.

Returns:
a PaymentGroupManager value.

setShippingGroupContainerService

public void setShippingGroupContainerService(atg.commerce.order.purchase.ShippingGroupContainerService pShippingGroupContainerService)
Parameters:
pShippingGroupContainerService - A new ShippingGroupContainerService.

getShippingGroupContainerService

public atg.commerce.order.purchase.ShippingGroupContainerService getShippingGroupContainerService()
Returns:
Returns the ShippingGroupContainerService.

getResourceBundle

protected java.util.ResourceBundle getResourceBundle()
Returns:
the error message ResourceBundle.

getResourceBundleName

protected java.lang.String getResourceBundleName()
Returns:
the name of the error message ResourceBundle.

isPayingWithOnlineCredit

protected boolean isPayingWithOnlineCredit(java.lang.String[] pOnlineCreditIds)
Checks to see if user is paying with a stored credit card.

Parameters:
pOnlineCreditIds - the online credit cards ids.
Returns:
true if success, otherwise false.

saveCreditCardToProfile

public void saveCreditCardToProfile(atg.commerce.order.Order pOrder,
                                    atg.repository.RepositoryItem pProfile,
                                    java.lang.String pCreditCardNickName)
This method saves the credit card from the payment group to the profile. And Save credit card as profile default if it is.

Parameters:
pOrder - the order.
pProfile - the profile.
pCreditCardNickName - the credit card nick name.

saveBillingAddressToProfile

public void saveBillingAddressToProfile(atg.commerce.order.Order pOrder,
                                        atg.repository.RepositoryItem pProfile,
                                        java.lang.String pBillingAddressNickname)
This method saves the Billing Address to the profile.

Parameters:
pOrder - the order.
pProfile - the profile.
pBillingAddressNickname - the billing address nickname.

saveDefaultBillingAddress

public void saveDefaultBillingAddress(atg.repository.RepositoryItem pProfile,
                                      atg.commerce.order.CreditCard pCreditCard)
Saves the address on the credit card to the user's default billing address.

Parameters:
pProfile - the profile.
pCreditCard - the credit card.

addBillingAddressToCard

protected void addBillingAddressToCard(atg.commerce.order.CreditCard pCard,
                                       boolean pUsingStoredAddress,
                                       java.lang.String pStoredAddressSelection,
                                       atg.repository.RepositoryItem pProfile,
                                       atg.commerce.order.Order pOrder)
                                throws atg.commerce.CommerceException
This method checks to see if the user chose a profile address. If so, the address is copied from the address book to the credit card.

Parameters:
pCard - the card.
pStoredAddressSelection - the stored address selection.
pProfile - the profile.
pOrder - the order.
Throws:
atg.commerce.CommerceException - indicates that a severe error occured while performing a commerce operation.

copyCreditCardFromProfile

protected void copyCreditCardFromProfile(atg.commerce.order.CreditCard pCreditCard,
                                         java.lang.String pNickname,
                                         atg.repository.RepositoryItem pProfile,
                                         java.util.Locale pUserLocale)
Utility method to copy credit card from profile to order.

Parameters:
pCreditCard - - Instance of Credit Card Payment Group.
pNickname - - nickname profile stored credit card nick name.
pProfile - - Instance of Profile Repository.
pUserLocale - - Locale.

validateSufficientOnlineCredit

protected double validateSufficientOnlineCredit(java.lang.String[] pOnlineCreditIds,
                                                atg.commerce.order.Order pOrder)
This method verifies if the online credit(s) total is sufficient to cover the order total. Note the need to calculate the true amount remaining by subtracting the amount authorized. The uncovered amount of the order total is returned.

Parameters:
pOnlineCreditIds - the online credits ids.
pOrder - the order.
Returns:
true if success, otherwise false.

getOrderRemaningAmount

public double getOrderRemaningAmount(atg.commerce.order.Order pOrder)
                              throws atg.commerce.CommerceException
Get the remaining Amount from the order.

Throws:
atg.commerce.CommerceException - if commerce error occurs.

isNewCreditCards

protected boolean isNewCreditCards(atg.commerce.order.Order pOrder)
Returns:
true if credit cards are new, otherwise false.

isCreditCardEmpty

protected boolean isCreditCardEmpty(atg.commerce.order.CreditCard pCreditCard)
Deprecated. this method has been moved to CommerceProfileTools.

Checks to see if a CreditCard object is empty. Empty means that certain necessary fields are missing. The properties that it checks for are those specified by the creditCardProperties String array.

This behavior can be overridden by making additions to the String array creditCardProperties, or if necessary extending this method.

Parameters:
pCreditCard - a value of type 'CreditCard'.
Returns:
true if the payment group is empty.

removeStoreCreditPaymentGroups

protected void removeStoreCreditPaymentGroups(atg.commerce.order.Order pOrder)
Remove any store credit payment groups from order.

Parameters:
pOrder. -

setupStoreCreditPaymentGroupsForOrder

public void setupStoreCreditPaymentGroupsForOrder(atg.commerce.order.Order pOrder,
                                                  atg.repository.RepositoryItem pProfile,
                                                  java.lang.String[] pOnlineCreditIds)
                                           throws atg.commerce.CommerceException,
                                                  atg.repository.RepositoryException,
                                                  java.io.IOException,
                                                  javax.servlet.ServletException
Initialize Store Credit Payment Group, add amount to the payment group and add remainng amount to other payment groups CreditCard.

Parameters:
pOrder - - the order to set-up.
pProfile - - the profile to which the order belongs.
pOnlineCreditIds - - the online credit cards ids.
Throws:
atg.commerce.CommerceException - if an error occurs
atg.repository.RepositoryException - if an error occurs
java.io.IOException - if an error occurs
javax.servlet.ServletException - if an error occurs

initializePaymentGroups

protected boolean initializePaymentGroups(atg.commerce.order.Order pOrder,
                                          atg.repository.RepositoryItem pProfile,
                                          java.lang.String[] pOnlineCreditIds)
                                   throws atg.commerce.CommerceException,
                                          javax.servlet.ServletException,
                                          java.io.IOException
Initializes the store credit payment method(s) based on the store credits the user chose.

Returns:
true on success, otherwise false.
Throws:
javax.servlet.ServletException - If servlet exception occurs.
java.io.IOException - If IO exception occurs.
atg.commerce.CommerceException

addCreditCardAuthorizationNumber

public void addCreditCardAuthorizationNumber(atg.commerce.order.Order pOrder,
                                             java.lang.String pCreditCardVerificationNumber)
Add Credit Card Verification Number to the CreditCard Payment Group.

Parameters:
pOrder - - the order that the credit card information is related to.
pCreditCardVerificationNumber - - the credit card's verification number.

validateCreditCardAuthorizationNumber

public boolean validateCreditCardAuthorizationNumber(java.lang.String pCreditCardVerificationNumber)
Verify the Credit Card verification number.

Parameters:
pCreditCardVerificationNumber - - the credit card's verification number.
Returns:
true if StoreConfiguration.isRequireCreditCardVerification is false and given authorization number is valid, otherwise return false.

addCreditCardDetails

public void addCreditCardDetails(atg.commerce.order.CreditCard pCreditCard,
                                 boolean pUsingStoredCreditCard,
                                 java.lang.String pStoredCreditCardName,
                                 atg.repository.RepositoryItem pProfile,
                                 java.util.Locale pUserLocale)
Copy credit card from profile to order if paying with profile credit card.

Parameters:
pCreditCard - - Instance of Credit Card Payment Group.
pStoredCreditCardName - - Nickname profile stored credit card nick name.
pProfile - - Instance of Profile Repository.
pUserLocale - - The user's locale.

getCreditCard

public atg.commerce.order.CreditCard getCreditCard(atg.commerce.order.Order pOrder)
Utility method to fetch credit card and set properties from page.

Returns:
credit card for this order.

addOrderAmountRemainingToCreditPaymentGroup

public void addOrderAmountRemainingToCreditPaymentGroup(atg.commerce.order.Order pOrder)
                                                 throws atg.commerce.CommerceException,
                                                        atg.commerce.order.InvalidParameterException
Added Remaining Order Amount relationship To Credit Card PaymentGroup. Remove remaining Order Amount relationship if all payment payed by other payment groups like Online Credit.

Parameters:
pOrder - - the order to process.
Throws:
atg.commerce.CommerceException
atg.commerce.order.InvalidParameterException

setupCreditCardPaymentGroupsForOrder

public boolean setupCreditCardPaymentGroupsForOrder(atg.commerce.order.Order pOrder,
                                                    atg.repository.RepositoryItem pProfile,
                                                    boolean pUsingStoredCreditCard,
                                                    java.lang.String pStoredCreditCardName,
                                                    java.util.Locale pUserLocale)
                                             throws atg.commerce.CommerceException,
                                                    atg.commerce.order.InvalidParameterException
Added remaining order amount to the payment group for given pStoredCreditCardName. If pStoredCreditCardName is not empty, then copy credit card details from pProfile to pOrder.

Parameters:
pOrder - the order to process.
pProfile - user profile.
pStoredCreditCardName - credit card nickname.
pUserLocale - the user locale.
Returns:
true if credit card details added to the order.
Throws:
atg.commerce.CommerceException
atg.commerce.order.InvalidParameterException

runProcessMoveToConfirmation

protected atg.service.pipeline.PipelineResult runProcessMoveToConfirmation(atg.commerce.order.Order pOrder,
                                                                           atg.commerce.pricing.PricingModelHolder pPricingModels,
                                                                           java.lang.String pMoveToConfirmationChainId,
                                                                           java.util.Locale pLocale,
                                                                           atg.repository.RepositoryItem pProfile,
                                                                           java.util.Map pExtraParameters)
                                                                    throws atg.service.pipeline.RunProcessException
Run the pipeline which should be executed at the last of the billing process.

Parameters:
pOrder - - the order to re-price.
pPricingModels - - the set of all pricing models for the user (item, order, shipping, tax).
pLocale - - the locale that the order should be priced within.
pProfile - - the user who owns the order.
pExtraParameters - -a Map of extra parameters to be used in the pricing.
Throws:
atg.service.pipeline.RunProcessException - if error running pipeline process.

isValidNickNameLength

public boolean isValidNickNameLength(java.lang.String pNickName,
                                     int pMinNickNameLength,
                                     int pMaxNickNameLength)
Utility method to check if user's NickName meets the minimum and maximum length.

Parameters:
pNickName - - the nickname to validate.
Returns:
true if nickname passes minimum/maximum validation checks, otherwise false.

validateCreditCardNicknameInput

public boolean validateCreditCardNicknameInput(atg.commerce.order.Order pOrder,
                                               atg.repository.RepositoryItem pProfile,
                                               java.lang.String pCreditCardNickname,
                                               int pMinNickNameLength,
                                               int pMaxNickNameLength)
                                        throws StorePurchaseProcessException
This method validates the credit card nickname if one is required.

Parameters:
pOrder - - the corresponding order.
pProfile - - the user's profile.
pCreditCardNickname - - the credit card's nickname.
pMinNickNameLength - - the minimum length allowed for a nickname.
pMaxNickNameLength - - the maximum length allowed for a nickname.
Returns:
true if success else return false.
Throws:
StorePurchaseProcessException

isPaymentGroupOrderRelationShipExist

public boolean isPaymentGroupOrderRelationShipExist(atg.commerce.order.PaymentGroup pPaymentGroup)
Verify, whether Order Relationship exists in the given Payment Group or not.

Parameters:
pPaymentGroup - - the payment group to process.
Returns:
true if relation ship found, otherwise return false.

getStoreCreditIds

public java.lang.String[] getStoreCreditIds(atg.repository.RepositoryItem pProfile)
This method returns store credits that for the given profile that can be used for the order.

Parameters:
pProfile - profile repository item.
Returns:
array of store credit IDs.

validateCreditCardRequiredFields

protected boolean validateCreditCardRequiredFields(atg.commerce.order.CreditCard card,
                                                   java.lang.String pVerificationNumber,
                                                   java.lang.String pNickname)
Check required fields for the new credit card.

Parameters:
card - CreditCard object.
pVerificationNumber - - new verification number for credit card.
pNickname - - credit card's nickname.
Returns:
false if one of the required fields is null or empty.