com.softslate.commerce.businessobjects.payment
Class BasePaymentProcessor

java.lang.Object
  extended by com.softslate.commerce.businessobjects.core.BaseBusinessObject
      extended by com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
          extended by com.softslate.commerce.businessobjects.payment.BasePaymentProcessor
All Implemented Interfaces:
BusinessObject, BusinessProcessor, PaymentProcessor
Direct Known Subclasses:
AuthorizeNetProcessor, BasePayPalNVPProcessor, BasicPaymentProcessor, CheckPaymentProcessor, PayflowLinkProcessor, PayPalExpressProcessor, PaypointProcessor

public abstract class BasePaymentProcessor
extends BaseBusinessProcessor
implements PaymentProcessor

Abstract class that provides methods useful for PaymentProcessor implementations.

Author:
David Tobey

Field Summary
(package private) static org.apache.commons.logging.Log log
           
 
Constructor Summary
BasePaymentProcessor()
           
 
Method Summary
 Payment findPaymentWithLiveInfo(Order order)
          A utility method that returns the first Payment under the given Order that has a full credit card number stored.
abstract  java.util.Map process(java.util.Map parameters)
          Subclasses must override this method to execute processing.
 java.util.Map processPayment(java.util.Map parameters)
          Assists with processing of payments.
 
Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getProductIDs, getSettings, getUser, initialize, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setSettings, setUser, updateOrderTotals, updateOrderTotals, utils
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessProcessor
getAppComponents, getAppSettings, getBusinessObjectFactory, getDaoFactory, getSettings, getUser, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setSettings, setUser, utils
 
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initialize
 

Field Detail

log

static org.apache.commons.logging.Log log
Constructor Detail

BasePaymentProcessor

public BasePaymentProcessor()
Method Detail

process

public abstract java.util.Map process(java.util.Map parameters)
                               throws java.lang.Exception
Subclasses must override this method to execute processing. Called by processPayment(Map).

Parameters:
parameters - A Map containing the values of the user's submitted payment information.
Returns:
A Map containing a least one key named "resultCode", which contains a String parsable into an int, representing the results of the processing. 0 for the resultCode indicates success. Optionally, the Map may include additional keys, such as "resultMessage", a string describing the results of the processing.
Throws:
java.lang.Exception

processPayment

public java.util.Map processPayment(java.util.Map parameters)
                             throws java.lang.Exception
Assists with processing of payments. Copies the incoming Map of parameters to this BasePaymentProcessor instance and calls process(). Catches any exception that occur within the processor and marks the user's order as corrupt if any occur. This method also skips processing if the store's "paymentRequired" settings is set to false.

Specified by:
processPayment in interface PaymentProcessor
Parameters:
parameters - A Map containing the values of the user's submitted payment information.
Returns:
A Map containing a least one key named "resultCode", which contains a String parsable into an int, representing the results of the processing. 0 for the resultCode indicates success. Optionally, the Map may include additional keys, such as "resultMessage", a string describing the results of the processing.
Throws:
java.lang.Exception

findPaymentWithLiveInfo

public Payment findPaymentWithLiveInfo(Order order)
                                throws java.lang.Exception
A utility method that returns the first Payment under the given Order that has a full credit card number stored. It first decrypts the credit card number (if called for by the settings). Useful for functions that must look up the credit card information for a given order.

Parameters:
order - The Order being examined.
Returns:
A Payment object that has a credit card number stored with it.
Throws:
java.lang.Exception


Copyright © SoftSlate, LLC 2003–2005