Class 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 Details

    • log

      static org.apache.commons.logging.Log log
  • Constructor Details

    • BasePaymentProcessor

      public BasePaymentProcessor()
  • Method Details

    • process

      public abstract Map process(Map parameters) throws 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:
      Exception
    • processPayment

      public Map processPayment(Map parameters) throws 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:
      Exception
    • findPaymentWithLiveInfo

      public Payment findPaymentWithLiveInfo(Order order) throws 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:
      Exception
    • processPaymentCapture

      public Map processPaymentCapture(Order order) throws Exception
      Specified by:
      processPaymentCapture in interface PaymentProcessor
      Throws:
      Exception
    • processVoid

      public Map processVoid(Map parameters) throws Exception
      Specified by:
      processVoid in interface PaymentProcessor
      Throws:
      Exception