Class PayPalExpressProcessor
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.PayPalExpressProcessor
- All Implemented Interfaces:
BusinessObject,BusinessProcessor,IPayPalExpressPaymentProcessor,PaymentProcessor
- Direct Known Subclasses:
PayPalDirectProcessor
public class PayPalExpressProcessor
extends BasePaymentProcessor
implements IPayPalExpressPaymentProcessor
Processes a payment in the store for a given user's cart through PayPal
Express Checkout. The three API calls required by PayPal Express integration
are handled in the
processSetExpressCheckout(java.util.Map),
processGetExpressCheckoutDetails(java.util.Map), and
processDoExpressCheckoutPayment(java.util.Map) methods.- Author:
- David Tobey
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate urn.ebay.apis.eBLBaseComponents.PaymentDetailsItemType[]convertCartToPayPalItems(Order order) convertStateOrProvice(String rawStateOrProvice) private DoubledeterminePayPalOrderTotal(urn.ebay.apis.eBLBaseComponents.PaymentDetailsItemType[] paypalItems) protected MapprepareResponseFromSetExpressCheckoutResponseType(urn.ebay.apis.eBLBaseComponents.AbstractResponseType ppresponse) Subclasses must override this method to execute processing.processDoExpressCheckoutPayment(Map parameters) processGetExpressCheckoutDetails(Map parameters) processSetExpressCheckout(Map parameters) voidprocessSuccessfulTransaction(Map parameters) Methods inherited from class com.softslate.commerce.businessobjects.payment.BasePaymentProcessor
findPaymentWithLiveInfo, processPayment, processPaymentCapture, processVoidMethods 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, utilsMethods inherited from interface com.softslate.commerce.businessobjects.payment.PaymentProcessor
processPayment, processPaymentCapture, processVoid
-
Field Details
-
log
static org.apache.commons.logging.Log log
-
-
Constructor Details
-
PayPalExpressProcessor
public PayPalExpressProcessor()
-
-
Method Details
-
createPaypalConfigMap
- Throws:
Exception
-
processSetExpressCheckout
- Specified by:
processSetExpressCheckoutin interfaceIPayPalExpressPaymentProcessor- Throws:
Exception
-
prepareResponseFromSetExpressCheckoutResponseType
protected Map prepareResponseFromSetExpressCheckoutResponseType(urn.ebay.apis.eBLBaseComponents.AbstractResponseType ppresponse) -
processGetExpressCheckoutDetails
- Specified by:
processGetExpressCheckoutDetailsin interfaceIPayPalExpressPaymentProcessor- Throws:
Exception
-
processDoExpressCheckoutPayment
- Specified by:
processDoExpressCheckoutPaymentin interfaceIPayPalExpressPaymentProcessor- Throws:
Exception
-
process
Description copied from class:BasePaymentProcessorSubclasses must override this method to execute processing. Called byBasePaymentProcessor.processPayment(Map).- Specified by:
processin classBasePaymentProcessor- 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
-
processSuccessfulTransaction
- Throws:
Exception
-
convertStateOrProvice
-
convertCartToPayPalItems
private urn.ebay.apis.eBLBaseComponents.PaymentDetailsItemType[] convertCartToPayPalItems(Order order) -
determinePayPalOrderTotal
private Double determinePayPalOrderTotal(urn.ebay.apis.eBLBaseComponents.PaymentDetailsItemType[] paypalItems)
-