com.konakart.bl.modules.payment
Class PaymentMgr

java.lang.Object
  extended by com.konakart.bl.BaseMgr
      extended by com.konakart.bl.modules.payment.PaymentMgr
All Implemented Interfaces:
PaymentMgrIf

public class PaymentMgr
extends BaseMgr
implements PaymentMgrIf

PaymentMgr


Nested Class Summary
protected  class PaymentMgr.SortOrderComparator
           
protected  class PaymentMgr.StaticData
          Used to store the static data of this manager
 
Field Summary
protected static org.apache.commons.logging.Log log
          the log
protected static java.lang.String MODULE_PAYMENT_INSTALLED
           
protected static java.lang.String mutex
           
protected static java.util.Map<java.lang.String,PaymentMgr.StaticData> staticDataHM
          Hash Map that contains the static data
 
Fields inherited from class com.konakart.bl.BaseMgr
templateBaseDir
 
Constructor Summary
PaymentMgr(KKEngIf eng)
          Constructor
 
Method Summary
protected  void addCurrencyToOrder(Order order)
          Ensure that the order has the currency object instantiated.
protected  java.lang.String getJavaModuleName(java.lang.String moduleName)
          Whatever the module name is, the package name is the module name in lowercase and the class name starts with an upper case character
 PaymentDetails getPaymentDetails(java.lang.String sessionId, java.lang.String moduleCode, int orderId, java.lang.String hostAndPort, int languageId)
          This method is called once a payment gateway has been selected and an order has been saved in the database.
 PaymentDetails getPaymentDetailsPerOrder(java.lang.String sessionId, java.lang.String moduleCode, OrderIf order, java.lang.String hostAndPort, int languageId)
          This method is called once a payment gateway has been selected even if the order has not been saved in the database.
 PaymentDetails getPaymentGateway(OrderIf order, java.lang.String moduleName, int languageId)
          Return the PaymentDetail object for one payment gateway.
 PaymentDetails[] getPaymentGateways(OrderIf order, int languageId)
          Each payment module is called and asked to return a PaymentDetails object.
protected  PaymentDetails[] getPaymentGatewaysPrivate(OrderIf order, java.lang.String moduleName, int languageId)
           
protected  PaymentInfo getPaymentInfo(Order order, int languageId)
          Returns a partially filled payment info object
 void refreshConfigs()
          Refreshes the configuration data for this manager
 
Methods inherited from class com.konakart.bl.BaseMgr
addInsertAttr, addInsertAttr, checkRequired, getAdminEngMgr, getBasketMgr, getBillingMgr, getBookableProductMgr, getCatMgr, getConfigMgr, getCookieMgr, getCurrMgr, getCustMgr, getCustomerIdFromSession, getCustomerStatsMgr, getCustomerTagMgr, getEmailMgr, getEng, getLangMgr, getManuMgr, getMiscItemMgr, getMode, getModeString, getMqMgr, getMultiStoreMgr, getNewCriteria, getNewCriteria, getOrderMgr, getOrderTotalMgr, getPaymentMgr, getProdMgr, getPromMgr, getRewardPointMgr, getSecMgr, getShippingMgr, getSolrMgr, getStoreId, getTaxMgr, getTemplate, getTemplateRoot, getVelocityContextMgr, getWishListMgr, init, isEnterprise, isMultiStoreShareCustomers, isMultiStoreShareProducts
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
the log


mutex

protected static java.lang.String mutex

staticDataHM

protected static java.util.Map<java.lang.String,PaymentMgr.StaticData> staticDataHM
Hash Map that contains the static data


MODULE_PAYMENT_INSTALLED

protected static final java.lang.String MODULE_PAYMENT_INSTALLED
See Also:
Constant Field Values
Constructor Detail

PaymentMgr

public PaymentMgr(KKEngIf eng)
           throws java.lang.Exception
Constructor

Parameters:
eng -
Throws:
java.lang.Exception
Method Detail

refreshConfigs

public void refreshConfigs()
                    throws java.lang.Exception
Description copied from interface: PaymentMgrIf
Refreshes the configuration data for this manager

Specified by:
refreshConfigs in interface PaymentMgrIf
Throws:
java.lang.Exception

getJavaModuleName

protected java.lang.String getJavaModuleName(java.lang.String moduleName)
Whatever the module name is, the package name is the module name in lowercase and the class name starts with an upper case character

Parameters:
moduleName -
Returns:
Returns the java compatible name

getPaymentGateways

public PaymentDetails[] getPaymentGateways(OrderIf order,
                                           int languageId)
                                    throws java.lang.Exception
Each payment module is called and asked to return a PaymentDetails object. This method is called during the checkout process before the order has been saved and confirmed by the user. Therefore it does not require the exact details for the payment (i.e. the parameters passed to a payment gateway) since this will be done later for the selected payment module. The returned PaymentDetails object contains the information required for the user to select it and based on the zone of the billing address the module may decide that it cannot process payment for that zone and so not even return a PaymentDetails object.

Specified by:
getPaymentGateways in interface PaymentMgrIf
Parameters:
order -
languageId -
Returns:
Returns an array of PaymentDetail objects
Throws:
java.lang.Exception

getPaymentGateway

public PaymentDetails getPaymentGateway(OrderIf order,
                                        java.lang.String moduleName,
                                        int languageId)
                                 throws java.lang.Exception
Return the PaymentDetail object for one payment gateway.

Specified by:
getPaymentGateway in interface PaymentMgrIf
Parameters:
order -
moduleName -
languageId -
Returns:
Returns an array of PaymentDetail objects
Throws:
java.lang.Exception

getPaymentGatewaysPrivate

protected PaymentDetails[] getPaymentGatewaysPrivate(OrderIf order,
                                                     java.lang.String moduleName,
                                                     int languageId)
                                              throws java.lang.Exception
Parameters:
order -
moduleName -
languageId -
Returns:
Returns an array of PaymentDetail objects
Throws:
java.lang.Exception

getPaymentDetails

public PaymentDetails getPaymentDetails(java.lang.String sessionId,
                                        java.lang.String moduleCode,
                                        int orderId,
                                        java.lang.String hostAndPort,
                                        int languageId)
                                 throws java.lang.Exception
This method is called once a payment gateway has been selected and an order has been saved in the database. The order is read from the database and the details of the payment are retrieved from the order. This ensures that the payment request matches the order exactly.

The module matching the module code is called in order to get a fully populated PaymentDetails object containing all of the required parameters etc. for the payment gateway.

Specified by:
getPaymentDetails in interface PaymentMgrIf
Parameters:
sessionId -
moduleCode -
orderId -
hostAndPort -
languageId -
Returns:
Return an array of PaymentDetail objects
Throws:
java.lang.Exception

getPaymentDetailsPerOrder

public PaymentDetails getPaymentDetailsPerOrder(java.lang.String sessionId,
                                                java.lang.String moduleCode,
                                                OrderIf order,
                                                java.lang.String hostAndPort,
                                                int languageId)
                                         throws java.lang.Exception
This method is called once a payment gateway has been selected even if the order has not been saved in the database. The details of the payment are retrieved from the order.

The module matching the module code is called in order to get a fully populated PaymentDetails object containing all of the required parameters etc. for the payment gateway.

Specified by:
getPaymentDetailsPerOrder in interface PaymentMgrIf
Parameters:
sessionId -
moduleCode -
order -
hostAndPort -
languageId -
Returns:
Return an array of PaymentDetail objects
Throws:
java.lang.Exception

getPaymentInfo

protected PaymentInfo getPaymentInfo(Order order,
                                     int languageId)
                              throws java.lang.Exception
Returns a partially filled payment info object

Parameters:
order -
languageId -
Returns:
Returns a PaymentInfo object
Throws:
java.lang.Exception

addCurrencyToOrder

protected void addCurrencyToOrder(Order order)
                           throws java.lang.Exception
Ensure that the order has the currency object instantiated.

Parameters:
order -
Throws:
java.lang.Exception


Copyright © 2011 DS Data Systems UK Ltd.