Class PayflowProProcessor
java.lang.Object
com.softslate.commerce.businessobjects.core.BaseBusinessObject
com.softslate.commerce.businessobjects.core.BaseBusinessProcessor
com.softslate.commerce.businessobjects.payment.BasePaymentProcessor
com.softslate.commerce.businessobjects.payment.BasePayPalNVPProcessor
com.softslate.commerce.businessobjects.payment.PayflowProProcessor
- All Implemented Interfaces:
BusinessObject
,BusinessProcessor
,PaymentProcessor
Processes a payment in the store for a given user's cart. This implementation
processes a request through PayPal Payflow Pro. The
process(Map)
method manages the process of sending a request to Payflow Pro, and handling
the response appropriately. It follows these steps:
- Figures out the transaction type (sale, authorize, authorize/authenticate, or authorize/authenticate/sale) from the database settings and the user's current state.
- Builds the request to Payflow Pro as a
Map
, taking as input the current user's state, and various database settings. - Converts the request into a url-encoded query string to pass as Payflow Pro's "parmlist" parameter.
- Initializes the connection to Payflow Pro and sends the request.
- Handles any errors by setting "resultCode" appropriately in the
Map
that is returned. If no response comes back from Payflow Pro, a result code 10000 is used. If the Payflow Pro result code is not 0, which also indicates an error, that code is used as this method's "resultCode" and this method returns it. - If a successful response is received, checks if the transaction type for the user is AA or AAS (authorize/authenticate, or authorize/authenticate/sale), in which the response must be "authenticated". This means the AVS and CSC responses are checked against what's defined as acceptable in the Payflow Pro Advanced Settings in the administrator. Note that if no CSC response is present, it is set to "X".
- If the user is not deemed authenticated, a "resultCode" of 10001 is returned.
- If the user is authenticated and the transaction type in effect is AAS (authorize/authenticate/sale), an immediate delayed capture on the previous authorization is performed, using the same parameters. Any errors from this second request are handled in the same way as above.
- Assuming the transaction succeeds, a new record is written to the sscPayment database table and a resultCode of 0 is returned.
- Author:
- David Tobey
- See Also:
-
Field Summary
FieldsFields inherited from class com.softslate.commerce.businessobjects.payment.BasePayPalNVPProcessor
CERT_PATH, COMMENT1, COMMENT2, CUSTOMER_CODE, CUSTOMER_REF, DESCRIPTION, HOST_ADDRESS, HOST_PORT, PARTNER, PASSWORD, PO_NUMBER, PROXY_ADDR, PROXY_LOGON, PROXY_PASSWD, PROXY_PORT, TIME_OUT, USER, VENDOR, VERBOSITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isAuthenticated
(String transAuthLevel, Map responseMap) boolean
levelMatchFound
(String cust, String floor, String ceiling, String countries) protected Map
preparePaypalRequestAcutalPayload
(Map params, Map parameters) Subclasses must override this method to execute processing.protected void
setPaymentVariablesToPersist
(Payment payment, Map parameters, Map responseMap) Methods inherited from class com.softslate.commerce.businessobjects.payment.BasePayPalNVPProcessor
initializeConnection, makePayPalCall, preparePayPalAuthRequest, preparePaypalLengthParameters, preparePaypalRequest, preparePaypalRequestCommonPayload, processSuccessfulTransaction
Methods inherited from class com.softslate.commerce.businessobjects.payment.BasePaymentProcessor
findPaymentWithLiveInfo, processPayment, processPaymentCapture, processVoid
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
Methods inherited from interface com.softslate.commerce.businessobjects.payment.PaymentProcessor
processPayment, processPaymentCapture, processVoid
-
Field Details
-
log
static org.apache.commons.logging.Log log
-
-
Constructor Details
-
PayflowProProcessor
public PayflowProProcessor()
-
-
Method Details
-
process
Description copied from class:BasePaymentProcessor
Subclasses must override this method to execute processing. Called byBasePaymentProcessor.processPayment(Map)
.- Specified by:
process
in classBasePaymentProcessor
- 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
-
getTransAuthLevel
- Throws:
Exception
-
levelMatchFound
-
preparePaypalRequestAcutalPayload
- Specified by:
preparePaypalRequestAcutalPayload
in classBasePayPalNVPProcessor
-
isAuthenticated
- Throws:
Exception
-
setPaymentVariablesToPersist
- Specified by:
setPaymentVariablesToPersist
in classBasePayPalNVPProcessor
-