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
Fields -
Constructor Summary
Constructors -
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 MapSubclasses 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, utilsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject
initializeMethods 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- AMapcontaining the values of the user's submitted payment information.- Returns:
- A
Mapcontaining 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, theMapmay include additional keys, such as "resultMessage", a string describing the results of the processing. - Throws:
Exception
-
processPayment
Assists with processing of payments. Copies the incomingMapof parameters to thisBasePaymentProcessorinstance 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:
processPaymentin interfacePaymentProcessor- Parameters:
parameters- AMapcontaining the values of the user's submitted payment information.- Returns:
- A
Mapcontaining 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, theMapmay 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:
processPaymentCapturein interfacePaymentProcessor- Throws:
Exception
-
processVoid
- Specified by:
processVoidin interfacePaymentProcessor- Throws:
Exception
-