Class BasePaymentProcessor
java.lang.Object
com.softslate.commerce.businessobjects.core.BaseBusinessObject
com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
com.softslate.commerce.businessobjects.payment.BasePaymentProcessor
- All Implemented Interfaces:
BusinessObject
,BusinessProcessor
,PaymentProcessor
- Direct Known Subclasses:
AuthorizeNetAPIProcessor
,AuthorizeNetDPMProcessor
,BasePayPalNVPProcessor
,BasicPaymentProcessor
,CheckPaymentProcessor
,FirstDataProcessor
,PayflowLinkProcessor
,PayPalExpressProcessor
,PaypointProcessor
,PurchaseOrderPaymentProcessor
public abstract class BasePaymentProcessor
extends BaseBusinessProcessor
implements PaymentProcessor
Abstract class that provides methods useful for
PaymentProcessor
implementations.- Author:
- David Tobey
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfindPaymentWithLiveInfo
(Order order) A utility method that returns the first Payment under the given Order that has a full credit card number stored.abstract Map
Subclasses must override this method to execute processing.processPayment
(Map parameters) Assists with processing of payments.processPaymentCapture
(Order order) processVoid
(Map parameters) Methods inherited from class com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
formatDateTime, formatPrice, getAppComponents, getAppSettings, getAttributeIDs, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getProductIDs, getSettings, getUser, initialize, isProcessorClassActive, loadMatchingSkus, parseDateTime, parseResponseData, prepareRequestData, sendHTTPGet, sendHTTPPost, sendHTTPPost, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, updateOrderTotals, 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.BusinessObject
initialize
Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessProcessor
getAppComponents, getAppSettings, getBusinessObjectFactory, getDaoFactory, getEventBus, getInjector, getSettings, getUser, setAppComponents, setAppSettings, setBusinessObjectFactory, setDaoFactory, setEventBus, setInjector, setSettings, setUser, utils
-
Field Details
-
log
static org.apache.commons.logging.Log log
-
-
Constructor Details
-
BasePaymentProcessor
public BasePaymentProcessor()
-
-
Method Details
-
process
Subclasses must override this method to execute processing. Called byprocessPayment(Map)
.- Parameters:
parameters
- AMap
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, theMap
may include additional keys, such as "resultMessage", a string describing the results of the processing. - Throws:
Exception
-
processPayment
Assists with processing of payments. Copies the incomingMap
of parameters to thisBasePaymentProcessor
instance and callsprocess()
. 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 interfacePaymentProcessor
- Parameters:
parameters
- AMap
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, theMap
may include additional keys, such as "resultMessage", a string describing the results of the processing. - Throws:
Exception
-
findPaymentWithLiveInfo
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:
Exception
-
processPaymentCapture
- Specified by:
processPaymentCapture
in interfacePaymentProcessor
- Throws:
Exception
-
processVoid
- Specified by:
processVoid
in interfacePaymentProcessor
- Throws:
Exception
-