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.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, 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.


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.
static java.lang.String FIRSTNAME_PROP_NAME
           
static java.lang.String MIDDLENAME_PROP_NAME
           
protected static java.lang.String MSG_DUPLICATE_CC_NICKNAME
          Duplicate CC nickname message key.
protected static java.lang.String MSG_DUPLICATE_USER
          Dublicate user message key.
protected static java.lang.String MSG_EMAIL_IS_EMPTY
          E-mail is empty 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 MSG_PASSWORD_IS_EMPTY
          Password is empty message key.
protected static java.lang.String MSG_PASSWORD_WRONG_LENGTH
          Password wrong length message key.
protected static java.lang.String MSG_PASSWORDS_DONT_MATCH
          Password don't match 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
MSG_MULTIPLE_COUPONS_PER_ORDER, MSG_UNCLAIMABLE_COUPON, PRICING_ERROR, PRICING_ERROR_ADDRESS
 
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_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 Paymanet 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 addOrder(atg.commerce.order.Order pOrder)
          Add the Order into the Repository if it is transient
 void addOrderAmountRemainingToCreditPaymentGroup(atg.commerce.order.Order pOrder)
          Added Remaining Order Amount relationship To Credit Card PaymentGroup.
protected  void addUserToOptInList(atg.userprofiling.Profile pProfile, java.lang.String pEmailOptInSourceCode)
          Adds user to email opt-in list.
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.
 CheckoutOptionSelections getCheckoutOptionSelections()
           
 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()
          Returns the error message ResourceBundle
protected  java.lang.String getResourceBundleName()
          Returns the name of the error message ResourceBundle
 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 exist 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 min & max length.
protected  void registerNewUserDuringCheckout(atg.commerce.order.Order pOrder, atg.userprofiling.Profile pProfile, java.util.Map pProfileValues)
          This method will register a new user during checkout.
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.
protected  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 saveShippingInfo(atg.repository.RepositoryItem pProfile, atg.commerce.order.purchase.ShippingGroupMapContainer pShippingGroupMapContainer)
          Saves all addresses in the shipping group container's shipping group map.
 void setCheckoutOptionSelections(CheckoutOptionSelections pCheckoutOptionSelections)
           
 void setPaymentGroupManager(atg.commerce.order.PaymentGroupManager pPaymentGroupManager)
          Set the PaymentGroupManager property.
protected  void setProfileEmailAndLogin(atg.repository.RepositoryItem pProfile, java.lang.String pEmail)
          Set the EmailId and LoginId into the profile repository
protected  void setProfilePassword(atg.repository.RepositoryItem pProfile, java.lang.String pNewUserPassword)
          Set the password and LoginId into the profile repository
 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 remaning 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 validateEmailAddress(atg.repository.RepositoryItem pProfile, java.lang.String pEmail)
          Utility method to validate email address.
protected  boolean validatePassword(atg.repository.RepositoryItem pProfile, java.lang.String pNewUserPassword, java.lang.String pRetypeNewPassword)
          Utility method to validate password input.
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
addItemToShippingGroup, checkForRequiredAddressProperties, claimCoupon, claimCoupon, getAddressPropertyNameMap, getClaimableManager, getMandatoryStateCountryList, getPlaceUtils, getPricingTools, getRequiredAddressPropertyNames, getShippingGroupForItem, getStoreConfiguration, getStoreOrderTools, processGiftAddition, removeCoupon, removeCoupon, repriceOrder, setAddressPropertyNameMap, setClaimableManager, setPlaceUtils, setPricingTools, setRequiredAddressPropertyNames, setStoreConfiguration, setStoreOrderTools, tenderCoupon
 
Methods inherited from class atg.commerce.order.purchase.PurchaseProcessHelper
addCreditCardToOrder, addItemsToOrder, addItemsToOrder, addShippingAddressToOrder, adjustItemRelationshipsForQuantityChange, adjustNonGiftHandlingInstructionsForQuantityDecrease, adjustNonGiftHandlingInstructionsForQuantityIncrease, applyValueDictionary, copyCreditCardInfo, createCommerceItem, createConfigurableSubitems, createOrder, decreaseRelationshipQuantity, deleteItems, deleteItems, getAddItemToOrderChainId, getAddItemToOrderPricingOp, getCommerceItemManager, getDefaultHardgoodShippingGroupType, getDeleteItemsFromOrderPricingOp, getGiftlistManager, getOrderManager, getPipelineManager, getRepriceOrderChainId, getShippingGroupForItem, getShippingGroupManager, getTransactionManager, increaseRelationshipQuantity, isAddItemToDefaultShippingGroup, isTransactionMarkedAsRollBack, moveItemBetweenShippingGroups, processPipelineErrors, removeEntireRelationshipQuantity, removeItemQuantityFromShippingGroup, runProcess, runProcess, runProcess, runProcessAddItemToOrder, runProcessRepriceOrder, 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, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, 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, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, 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_DUPLICATE_USER

protected static final java.lang.String MSG_DUPLICATE_USER
Dublicate user message key.

See Also:
Constant Field Values

MSG_EMAIL_IS_EMPTY

protected static final java.lang.String MSG_EMAIL_IS_EMPTY
E-mail is empty message key.

See Also:
Constant Field Values

MSG_PASSWORDS_DONT_MATCH

protected static final java.lang.String MSG_PASSWORDS_DONT_MATCH
Password don't match message key.

See Also:
Constant Field Values

MSG_PASSWORD_IS_EMPTY

protected static final java.lang.String MSG_PASSWORD_IS_EMPTY
Password is empty message key.

See Also:
Constant Field Values

MSG_PASSWORD_WRONG_LENGTH

protected static final java.lang.String MSG_PASSWORD_WRONG_LENGTH
Password wrong length message key.

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

MIDDLENAME_PROP_NAME

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

FIRSTNAME_PROP_NAME

public static final java.lang.String FIRSTNAME_PROP_NAME
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

getCheckoutOptionSelections

public CheckoutOptionSelections getCheckoutOptionSelections()
Returns:
the CheckoutOptionSelections component.

setCheckoutOptionSelections

public void setCheckoutOptionSelections(CheckoutOptionSelections pCheckoutOptionSelections)
Parameters:
pCheckoutOptionSelections - the CheckoutOptionSelections component to set.

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.

Returns:
true if success, false - otherwise

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 -
pProfile -
pCreditCardNickName -

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 -
pProfile -
pBillingAddressNickname -

registerNewUserDuringCheckout

protected void registerNewUserDuringCheckout(atg.commerce.order.Order pOrder,
                                             atg.userprofiling.Profile pProfile,
                                             java.util.Map pProfileValues)
                                      throws atg.commerce.CommerceException
This method will register a new user during checkout.

Parameters:
pOrder -
pProfile -
pProfileValues -
Throws:
atg.commerce.CommerceException

addUserToOptInList

protected void addUserToOptInList(atg.userprofiling.Profile pProfile,
                                  java.lang.String pEmailOptInSourceCode)
Adds user to email opt-in list.

Parameters:
pProfile -
pEmailOptInSourceCode -

saveDefaultBillingAddress

protected 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 -
pCreditCard -

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 -
pStoredAddressSelection -
pProfile -
pOrder -
Throws:
atg.commerce.CommerceException

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

Returns:
true if success, false - otherwise

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, false - otherwise.

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 overriden 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 remaning amount to other payment groups CreditCard

Parameters:
pOrder -
pProfile -
pOnlineCreditIds -
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, false - otherwise
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 Paymanet Group.

Parameters:
pOrder -
pCreditCardVerificationNumber -

validateCreditCardAuthorizationNumber

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

Parameters:
pCreditCardVerificationNumber -
Returns:
true if StoreConfiguration.isRequireCreditCardVerification is false and given authorization number is valid else 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 -
pStoredCreditCardName -
pProfile -
pUserLocale -

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. Removed remaining Order Amount relationship if all payment payed by other payment groups Like Online Credit.

Parameters:
pOrder -
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 - order
pProfile - user profile
pStoredCreditCardName - credit card nickname
pUserLocale -
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 reprice
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

setProfileEmailAndLogin

protected void setProfileEmailAndLogin(atg.repository.RepositoryItem pProfile,
                                       java.lang.String pEmail)
Set the EmailId and LoginId into the profile repository

Parameters:
pProfile -
pEmail -

addOrder

public void addOrder(atg.commerce.order.Order pOrder)
Add the Order into the Repository if it is transient

Parameters:
pOrder -

setProfilePassword

protected void setProfilePassword(atg.repository.RepositoryItem pProfile,
                                  java.lang.String pNewUserPassword)
Set the password and LoginId into the profile repository

Parameters:
pProfile -
pNewUserPassword -

validateEmailAddress

protected boolean validateEmailAddress(atg.repository.RepositoryItem pProfile,
                                       java.lang.String pEmail)
                                throws StorePurchaseProcessException
Utility method to validate email address.

Returns:
true if success, false - otherwise
Throws:
StorePurchaseProcessException

validatePassword

protected boolean validatePassword(atg.repository.RepositoryItem pProfile,
                                   java.lang.String pNewUserPassword,
                                   java.lang.String pRetypeNewPassword)
                            throws StorePurchaseProcessException
Utility method to validate password input.

Returns:
true if success, false - otherwise
Throws:
StorePurchaseProcessException

isValidNickNameLength

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

Parameters:
pNickName - is NickName string
Returns:
True if NickName meets min/max requirements False if NickName fails min/max requirements

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 -
pProfile -
pCreditCardNickname -
pMinNickNameLength -
pMaxNickNameLength -
Returns:
true if success else return false
Throws:
StorePurchaseProcessException

isPaymentGroupOrderRelationShipExist

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

Parameters:
pPaymentGroup -
Returns:
true if relation ship found else return false

saveShippingInfo

public void saveShippingInfo(atg.repository.RepositoryItem pProfile,
                             atg.commerce.order.purchase.ShippingGroupMapContainer pShippingGroupMapContainer)
Saves all addresses in the shipping group container's shipping group map.

The key is used as the nick name. The shipping group's address is used for the address.

Also sets the default shipping method on the profile


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