Class AuthorizeNetAPIProcessor

All Implemented Interfaces:
BusinessObject, BusinessProcessor, PaymentProcessor
Direct Known Subclasses:
AuthorizeNetAIMProcessor

public class AuthorizeNetAPIProcessor extends BasePaymentProcessor implements PaymentProcessor
Processes a payment in the store for a given user's cart. This implementation processes a request through Authorize.net's AIM integration method.

If the transaction is declined a result code of 10000 is returned, if it is successful a result code of 0 is returned, and otherwise the result code sent back from Authorize.net is returned.

Author:
David Tobey
See Also:
  • Field Details

    • log

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

    • AuthorizeNetAPIProcessor

      public AuthorizeNetAPIProcessor()
  • Method Details

    • process

      public Map process(Map parameters) throws Exception
      Description copied from class: BasePaymentProcessor
      Subclasses must override this method to execute processing. Called by BasePaymentProcessor.processPayment(Map).
      Specified by:
      process in class BasePaymentProcessor
      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
    • processAcceptHostedResponse

      public Map processAcceptHostedResponse(Map parameters) throws Exception
      Throws:
      Exception
    • processAuthOnly

      public Map processAuthOnly(Map parameters) throws Exception
      Throws:
      Exception
    • processAuthCapture

      public Map processAuthCapture(Map parameters) throws Exception
      Throws:
      Exception
    • processPriorAuthCapture

      public Map processPriorAuthCapture(Map parameters) throws Exception
      Throws:
      Exception
    • processVoid

      public Map processVoid(Map parameters) throws Exception
      Specified by:
      processVoid in interface PaymentProcessor
      Overrides:
      processVoid in class BasePaymentProcessor
      Throws:
      Exception
    • processTransaction

      protected Map processTransaction(Map parameters) throws Exception
      Throws:
      Exception
    • createTransation

      protected Map createTransation(Map parameters) throws Exception
      Throws:
      Exception
    • createPaymentProfile

      public Map createPaymentProfile(Map parameters)
    • configureEnvironment

      protected net.authorize.Environment configureEnvironment(Map parameters)
    • configureMerchantAuthentication

      protected net.authorize.api.contract.v1.MerchantAuthenticationType configureMerchantAuthentication(Map parameters)
    • initTransactionRequest

      protected net.authorize.api.contract.v1.TransactionRequestType initTransactionRequest(Map parameters)
    • configureSolution

      protected net.authorize.api.contract.v1.SolutionType configureSolution(net.authorize.Environment env)
    • configureProfileBeingUsedForPayment

      protected net.authorize.api.contract.v1.CustomerProfilePaymentType configureProfileBeingUsedForPayment(Map parameters)
    • configureThatAProfileIsBeingRequested

      protected net.authorize.api.contract.v1.CustomerProfilePaymentType configureThatAProfileIsBeingRequested(Map parameters)
    • configurePayment

      protected net.authorize.api.contract.v1.PaymentType configurePayment(Map parameters)
    • configureTotals

      protected void configureTotals(net.authorize.api.contract.v1.TransactionRequestType txnRequest, Map parameters)
    • configureReferenceFields

      protected void configureReferenceFields(net.authorize.api.contract.v1.TransactionRequestType txnRequest, Map parameters)
    • configureTransactionSettings

      protected void configureTransactionSettings(net.authorize.api.contract.v1.TransactionRequestType txnRequest, Map parameters)
    • configureBillingAddress

      protected net.authorize.api.contract.v1.CustomerAddressType configureBillingAddress(Map parameters)
    • configureShippingAddress

      protected net.authorize.api.contract.v1.NameAndAddressType configureShippingAddress(Map parameters)
    • escapeAndTruncate

      protected String escapeAndTruncate(String value, int maxWidth)
    • escapeForIFrameCommunicator

      protected String escapeForIFrameCommunicator(String value)
    • processResponse

      protected Map processResponse(net.authorize.api.contract.v1.CreateTransactionResponse response, Map parameters) throws Exception
      Throws:
      Exception
    • processSuccessResponse

      protected Map processSuccessResponse(Map parameters, net.authorize.api.contract.v1.CreateTransactionResponse response) throws Exception
      Throws:
      Exception
    • processSuccessAcceptHostedResponse

      protected Map processSuccessAcceptHostedResponse(Map parameters, Map responseAsMap) throws Exception
      Throws:
      Exception
    • processErrorResponse

      protected Map processErrorResponse(Map parameters, String code, String message) throws Exception
      Throws:
      Exception
    • retrieveUnsettledTransactionList

      public Map retrieveUnsettledTransactionList(Map parameters)
    • createCustomerProfile

      public Map createCustomerProfile(Customer customer, Map parameters) throws Exception
      Throws:
      Exception
    • retrievePaymentProfiles

      public List<net.authorize.api.contract.v1.CustomerPaymentProfileMaskedType> retrievePaymentProfiles(String cimProfileID, boolean includeExpired)
    • retrievePaymentProfile

      public net.authorize.api.contract.v1.CustomerPaymentProfileMaskedType retrievePaymentProfile(String cimProfileID, String cimPaymentProfileID) throws Exception
      Throws:
      Exception
    • copyPaymentPaymentProfileToAddressForm

      public void copyPaymentPaymentProfileToAddressForm(net.authorize.api.contract.v1.CustomerPaymentProfileMaskedType paymentProfile, BillingAddressForm form)
    • editPaymentProfile

      public Map editPaymentProfile(Map parameters)
    • deletePaymentProfile

      public Map deletePaymentProfile(Map parameters)
    • hostedProfilePage

      public Map hostedProfilePage(Map parameters)
    • hostedPaymentPage

      public Map hostedPaymentPage(Map parameters)
    • configureCustomerIdInSessionAndTransactionRequest

      private String configureCustomerIdInSessionAndTransactionRequest(net.authorize.api.contract.v1.TransactionRequestType txnRequest)
    • createJsonSetting

      private net.authorize.api.contract.v1.SettingType createJsonSetting(String settingName, Map options)