com.ibm.commerce.payment.rules

Class QueryHandler

  • java.lang.Object
    • com.ibm.commerce.payment.rules.QueryHandler
  • All Implemented Interfaces:
    java.io.Serializable


    public class QueryHandler
    extends java.lang.Object
    implements java.io.Serializable

    Provides query functionality for EDP Internal components and CSR support.

    It uses information coming from three facades (Stateless Session Bean):

    • Object Model Facade (OMF )
    • Refund Facade
    • Activity Logger

    The parameter details when specified, will indicate that extra information is to be retrieved in a particular Activity Log Record (ALR) or list of ALRs.

    In the current implementation, acquiring detailed information means querying the payment backend system for an explanatory message on a kryptic error key. Or it means querying for return code returned in a failed or pending operation. Operations that have successfully completed don't have the explanatory information because the results and return codes are trivial.

    The parameter details might be used in the future for extra information that does not need to be retrieved in overall queries to the ALRs.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      QueryHandler(EDPServices localServices)
      Creates a new QueryHandler service object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.Collection getAvailablePaymentMethodsInStore(java.lang.String paymentGroupdId)
      Obtains a list of payment methods associated to a store that are available for shoppers to use.
      java.util.Collection getAvailableRefundMethodsInStore(java.lang.String paymentGroupdId)
      Method listRefundMethods .
      PaymentDataAnalyzer getBackendPaymentDataByAtomicPaymentId(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long policyId, java.lang.Long apId)
      Queries payment backend system for the current payment state information associated to an Atomic Payment.
      PaymentDataAnalyzer getBackendPaymentDataByBackendId(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long policyId, java.lang.String backendPaymentId)
      Queries payment backend system for the current payment state information.
      PaymentInstruction getBackendPaymentInstruction(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long policyId, java.lang.String backendPiId, java.lang.Boolean markSensitive)
      Gets the PPC backend data for a given payment instruction.
      java.util.Map getBackendPaymentInstructionData(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long policyId, java.lang.String backendPiId)
      Gets the PPC backend data for a given payment instruction.
      java.util.List getBackendPaymentInstructionInOrder(java.lang.Integer storeId, java.util.Locale locale, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long orderId, boolean maskSensitiveData)
      Get the valid backend payment instructions in an order.
      PaymentDataAnalyzer getBackendRefundData(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long raId)
      Queries payment backend system for the current payment state information associated to an Atomic Payment.
      PaymentDataAnalyzer getBackendRefundData(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.String paymentSystem, java.lang.String backendRefundInstructionId, java.lang.Long policyId, java.lang.String backendCreditId)
      Queries payment backend system for the current credit/refund state information.
      java.lang.String getBackendRefundStatus(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long rmaId, java.lang.String backendRefundInstructionId, java.lang.String backendCreditId, boolean needGlobalized)
      Queries payment backend system for the current credit/refund status.
      java.util.Collection getCompleteOrderActivityHistory(java.lang.Integer storeId, java.util.Locale locale, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long orderId, boolean details)
      Finds a complete history of Activity log Records (ALRs) for an order.
      java.util.Collection getCompleteRmaActivityHistory(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long rmaId, boolean details)
      Finds a complete history of Activity log Records (ALRs) for an RMA.
      java.lang.String getOverallEDPPaymentInstructionStatus(java.lang.Long piId, java.lang.Integer storeId, java.util.Locale locale, java.lang.Long orderId, boolean needGlobalized)
      Obtains the overall EDPpaymentInstruction status for a given PI in an order.
      java.lang.String getOverallOrderPaymentStatus(java.lang.Integer storeId, java.util.Locale locale, CommandContext commandContext, java.lang.Long orderId, boolean needGlobalized)
      Obtains the overall payment activity status in an order.
      java.lang.String getOverallPaymentInstructionStatus(java.lang.Integer storeId, java.util.Locale locale, java.lang.Long orderId, java.lang.String backendPaymentInstructionId, boolean needGlobalized)
      Obtains the overall life-cycle status of a payment instruction.
      java.lang.String getOverallRefundInstructionStatus(java.lang.Integer storeId, java.util.Locale locale, java.lang.Long rmaId, java.lang.String backendRefundInstructionid, boolean needGlobalized)
      Method getOverallRefundInstructionStatus.
      java.lang.String getOverallRmaRefundStatus(java.lang.Integer storeId, java.util.Locale locale, CommandContext commandContext, java.lang.Long rmaId, boolean needGlobalized)
      Obtains the overall payment activity status in an RMA.
      java.util.Collection getPaymentActivityHistory(java.lang.Integer storeId, java.util.Locale locale, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long orderOrRmaId, boolean details)
      Finds the payment activity history for an order.
      java.util.Collection getPaymentActivityHistoryByRelease(java.lang.Integer storeId, java.util.Locale locale, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long orderId, java.lang.Long releaseId, boolean details)
      Method getPaymentActivityHistoryByRelease.
      java.lang.String getPaymentConfigurationId(java.lang.Long policyId)
      get paymentConfigurationId from POLICY table by policy id
      java.util.Collection getPaymentInstructionActivityHistory(java.lang.Integer storeId, java.util.Locale locale, java.lang.Long orderId)
      Finds the payment instruction activity history for an order.
      java.util.Collection getPaymentInstructionsInOrder(java.lang.Integer storeId, java.util.Locale locale, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long orderId, boolean maskSensitiveData)
      Obtains a list of Payment Instructions associated to an order.
      java.util.Collection getRefundActivityHistory(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long rmaId, boolean details)
      Method getRefundActivityHistory.
      java.util.Collection getRefundInstructionActivityHistory(java.lang.Integer storeId, java.util.Locale locale, java.lang.Long rmaId)
      Finds the refunds instruction activity history for an RMA.
      java.util.Collection getRefundInstructionsInRma(java.lang.Integer storeId, java.lang.Long rmaId)
      Obtains a list of Refund Instructions associated to an RMA.
      java.util.Collection getReleasesInOrder(java.lang.Integer storeId, java.lang.Long orderId)
      Obtains a list of payment releases in the order.
      java.util.Collection getUnresolvedFailuresInOrder(java.lang.Integer storeId, java.util.Locale locale, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long orderId, boolean details)
      Obtains a list of Activity Log Records (ALR) that contains unresolved failures for an order.
      java.util.Collection getUnresolvedFailuresInRma(java.lang.Integer storeId, java.util.Locale locale, java.lang.String paymentGroupId, java.lang.String orderChannel, CommandContext commandContext, java.lang.Long rmaId, boolean details)
      Obtains a list of Activity Log Records (ALR) that contains unresolved failures for an RMA.
      java.util.Collection orderRecordsByDecreasingTimestamp(java.util.Collection inputRecords)
      Sorts a list of Activity Log Records (ALRs) keep the most recently created records first.
      java.util.Collection orderRecordsByDecreasingTimestamp(java.util.Collection inputRecords, java.lang.String payInsID)
      Sorts a list of Activity Log Records (ALRs) of one PI keep the most recently created records first.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        IBM copyright notice field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • QueryHandler

        public QueryHandler(EDPServices localServices)

        Creates a new QueryHandler service object.

        Parameters:
        localServices - the services (backend) to be used in queries
    • Method Detail

      • getAvailablePaymentMethodsInStore

        public java.util.Collection getAvailablePaymentMethodsInStore(java.lang.String paymentGroupdId)
                                                               throws CommunicationException,
                                                                      J2EEException

        Obtains a list of payment methods associated to a store that are available for shoppers to use.

        Parameters:
        paymentGroupdId -
        Returns:
        the list of payment methods (PaymentMethodData)associated to a store that can be used by shoppers
        Throws:
        CommunicationException - if communication with the payment backend system fails
        J2EEException - if EJBs cannot be accessed
        See Also:
        PaymentMethodData
      • getAvailableRefundMethodsInStore

        public java.util.Collection getAvailableRefundMethodsInStore(java.lang.String paymentGroupdId)
                                                              throws CommunicationException,
                                                                     J2EEException
        Method listRefundMethods .
        Parameters:
        paymentGroupdId -
        Returns:
        a list of available refund methods
        Throws:
        CommunicationException - cannot communicate with backend
        J2EEException - if EJBs cannot be accessed
      • getBackendPaymentDataByAtomicPaymentId

        public PaymentDataAnalyzer getBackendPaymentDataByAtomicPaymentId(java.lang.Integer storeId,
                                                                          java.util.Locale locale,
                                                                          java.lang.String paymentGroupId,
                                                                          java.lang.String orderChannel,
                                                                          CommandContext commandContext,
                                                                          java.lang.Long policyId,
                                                                          java.lang.Long apId)
                                                                   throws J2EEException,
                                                                          InputException,
                                                                          ECException

        Queries payment backend system for the current payment state information associated to an Atomic Payment.

        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        policyId -
        apId - the atomic payment that has a backend payment object associated
        Returns:
        the current state of the payment object in the payment backend system
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
        ECException
      • getBackendPaymentDataByBackendId

        public PaymentDataAnalyzer getBackendPaymentDataByBackendId(java.lang.Integer storeId,
                                                                    java.util.Locale locale,
                                                                    java.lang.String paymentGroupId,
                                                                    java.lang.String orderChannel,
                                                                    CommandContext commandContext,
                                                                    java.lang.Long policyId,
                                                                    java.lang.String backendPaymentId)
                                                             throws ECException

        Queries payment backend system for the current payment state information.

        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        policyId - policyId
        backendPaymentId - the name of the target payment system; it corresponds to a payment cassette/plugin
        Returns:
        the current state of the payment object in the payment backend system
        Throws:
        ECException - policy CMD throws
      • getBackendPaymentInstructionData

        public java.util.Map getBackendPaymentInstructionData(java.lang.Integer storeId,
                                                              java.util.Locale locale,
                                                              java.lang.String paymentGroupId,
                                                              java.lang.String orderChannel,
                                                              CommandContext commandContext,
                                                              java.lang.Long policyId,
                                                              java.lang.String backendPiId)
                                                       throws J2EEException,
                                                              BackendException,
                                                              ECException
        Gets the PPC backend data for a given payment instruction.
        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        policyId -
        backendPiId - the backend payment instruction id
        Returns:
        Map
        Throws:
        J2EEException - if EJBs cannot be accessed
        BackendException - if backend cannot be accessed
        ECException
      • getBackendPaymentInstruction

        public PaymentInstruction getBackendPaymentInstruction(java.lang.Integer storeId,
                                                               java.util.Locale locale,
                                                               java.lang.String paymentGroupId,
                                                               java.lang.String orderChannel,
                                                               CommandContext commandContext,
                                                               java.lang.Long policyId,
                                                               java.lang.String backendPiId,
                                                               java.lang.Boolean markSensitive)
                                                        throws J2EEException,
                                                               BackendException,
                                                               ECException
        Gets the PPC backend data for a given payment instruction.
        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        policyId -
        backendPiId - the backend payment instruction id
        markSensitive -
        Returns:
        Map
        Throws:
        J2EEException - if EJBs cannot be accessed
        BackendException - if backend cannot be accessed
        ECException
      • getBackendRefundData

        public PaymentDataAnalyzer getBackendRefundData(java.lang.Integer storeId,
                                                        java.util.Locale locale,
                                                        java.lang.String paymentGroupId,
                                                        java.lang.String orderChannel,
                                                        CommandContext commandContext,
                                                        java.lang.Long raId)
                                                 throws J2EEException,
                                                        InputException,
                                                        CommunicationException

        Queries payment backend system for the current payment state information associated to an Atomic Payment.

        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        raId - the id of atomic refund in EDP that has a backend payment object associated
        Returns:
        the current state of the payment object in the payment backend system
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
        CommunicationException - if communication with the payment backend system fails
      • getBackendRefundData

        public PaymentDataAnalyzer getBackendRefundData(java.lang.Integer storeId,
                                                        java.util.Locale locale,
                                                        java.lang.String paymentGroupId,
                                                        java.lang.String orderChannel,
                                                        CommandContext commandContext,
                                                        java.lang.String paymentSystem,
                                                        java.lang.String backendRefundInstructionId,
                                                        java.lang.Long policyId,
                                                        java.lang.String backendCreditId)
                                                 throws CommunicationException,
                                                        J2EEException

        Queries payment backend system for the current credit/refund state information.

        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        paymentSystem - the name of the target payment system; it corresponds to a payment cassette/plugin
        backendRefundInstructionId - the identifier of the refund instruction in the payment backend system
        policyId -
        backendCreditId - the identifier of the credit/refund object in the payment backend system
        Returns:
        the current state of the credit/refund object in the payment backend system
        Throws:
        CommunicationException - if communication with the payment backend system fails
        J2EEException - if EJBs cannot be accessed
      • getBackendRefundStatus

        public java.lang.String getBackendRefundStatus(java.lang.Integer storeId,
                                                       java.util.Locale locale,
                                                       java.lang.String paymentGroupId,
                                                       java.lang.String orderChannel,
                                                       CommandContext commandContext,
                                                       java.lang.Long rmaId,
                                                       java.lang.String backendRefundInstructionId,
                                                       java.lang.String backendCreditId,
                                                       boolean needGlobalized)
                                                throws InputException,
                                                       J2EEException,
                                                       CommunicationException

        Queries payment backend system for the current credit/refund status.

        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        rmaId - the identifier of an RMA; with storeId, uniquely identifies an RMA
        backendRefundInstructionId - the identifier of the refund instruction in the payment backend system
        backendCreditId - the identifier of the credit/refund object in the payment backend system
        needGlobalized - the flag indicating if the returned status is globalized or not
        Returns:
        a string describing the current status of a credit/refund object in the payment backend system. If needGlobalized is true, localized status will be returned. Otherwise, return the nonlocalized status: "new", the state of the Credit container after its creation. "crediting", the state of the Credit container while a credit transaction is pending. "credited", the state of the Credit container when a successful credit transaction has been completed. "failed", the state of the Credit container when a transaction has failed. "canceled", the state of the Credit container when it has been fully reversed. "reversing", the state of the Credit container while a reverse transaction is pending.
        Throws:
        InputException - if parameters are invalid (For example: null value)
        J2EEException - if EJBs cannot be accessed appropriately
        CommunicationException - if communication with the payment backend system fails
      • getCompleteOrderActivityHistory

        public java.util.Collection getCompleteOrderActivityHistory(java.lang.Integer storeId,
                                                                    java.util.Locale locale,
                                                                    java.lang.String orderChannel,
                                                                    CommandContext commandContext,
                                                                    java.lang.Long orderId,
                                                                    boolean details)
                                                             throws InputException,
                                                                    J2EEException,
                                                                    InternalException,
                                                                    ECException

        Finds a complete history of Activity log Records (ALRs) for an order.

        Parameters:
        storeId -
        locale -
        orderChannel -
        commandContext -
        orderId - the order identifier; it is unique when used with the storeId
        details - whether extra information on an ALR is to be retrieved from the payment backend system
        Returns:
        the complete activity history for a particular order
        Throws:
        InputException - if parameters are invalid (For example: null value)
        J2EEException - if EJBs cannot be accessed appropriately
        InternalException
        ECException
      • getCompleteRmaActivityHistory

        public java.util.Collection getCompleteRmaActivityHistory(java.lang.Integer storeId,
                                                                  java.util.Locale locale,
                                                                  java.lang.String paymentGroupId,
                                                                  java.lang.String orderChannel,
                                                                  CommandContext commandContext,
                                                                  java.lang.Long rmaId,
                                                                  boolean details)
                                                           throws InputException,
                                                                  J2EEException,
                                                                  InternalException,
                                                                  ECException

        Finds a complete history of Activity log Records (ALRs) for an RMA.

        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        rmaId - RMA identifier; it is unique when used with the storeId
        details - whether extra information on an ALR is to be retrieved from the payment backend system
        Returns:
        the complete activity history for a particular order
        Throws:
        InputException - if parameters are invalid (For example: null value)
        J2EEException - if EJBs cannot be accessed appropriately
        InternalException
        ECException
      • getOverallEDPPaymentInstructionStatus

        public java.lang.String getOverallEDPPaymentInstructionStatus(java.lang.Long piId,
                                                                      java.lang.Integer storeId,
                                                                      java.util.Locale locale,
                                                                      java.lang.Long orderId,
                                                                      boolean needGlobalized)
                                                               throws J2EEException,
                                                                      InputException

        Obtains the overall EDPpaymentInstruction status for a given PI in an order.

        The rules to determine the overall EDPpaymentInstruction status is:

        • if no action has happened, the status is Success.
        • if one or more actions have happened the status is
          Success If the last payment action for each PI has been successful.
          Pending If the last payment action of one or more PIs is in a pending state. And no Failed operation has happened as the last payment action of any of the other PIs .
          Failed If at least one of the last payment action of each PI has failed.
        Parameters:
        piId - the unique identifier for an EDP PI, not a backend PI
        storeId -
        locale -
        orderId - the identifier of the order; with the store id, uniquely identifies an order
        needGlobalized - the flag indicating if the returned status is globalized or not
        Returns:
        a localized, human-readable string describing the overall payment instruction status in an order if needGlobalized is true, otherwise, a nonlocalized status is returned
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
      • getOverallOrderPaymentStatus

        public java.lang.String getOverallOrderPaymentStatus(java.lang.Integer storeId,
                                                             java.util.Locale locale,
                                                             CommandContext commandContext,
                                                             java.lang.Long orderId,
                                                             boolean needGlobalized)
                                                      throws J2EEException,
                                                             InputException

        Obtains the overall payment activity status in an order.

        Parameters:
        storeId -
        locale -
        commandContext -
        orderId - the identifier of the order; with the store id, uniquely identifies an order
        needGlobalized - the flag indicating if the returned status is globalized or not
        Returns:
        a localized, human-readable string describing the overall payment activity status in an order if needGlobalized is true, otherwise, a nonlocalized string is returned
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
      • getOverallPaymentInstructionStatus

        public java.lang.String getOverallPaymentInstructionStatus(java.lang.Integer storeId,
                                                                   java.util.Locale locale,
                                                                   java.lang.Long orderId,
                                                                   java.lang.String backendPaymentInstructionId,
                                                                   boolean needGlobalized)
                                                            throws J2EEException,
                                                                   InputException

        Obtains the overall life-cycle status of a payment instruction.

        Life-cycle on Transaction Instructions (Payment Instructions or Refund Instructions) corresponds to the following operations: create, edit, cancel, remove

        Parameters:
        storeId -
        locale -
        orderId - the order or RMA identifier; it is unique when used with the storeId
        backendPaymentInstructionId - the unique identifier of a payment instruction in the payment backend system
        needGlobalized - the flag indicating if the returned status is globalized or not
        Returns:
        a localized, human-readable string describing the current status of the life-cycle of a payment instruction if needGlobalized is true. Otherwise, a nonlocalized string is returned
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
      • getOverallRefundInstructionStatus

        public java.lang.String getOverallRefundInstructionStatus(java.lang.Integer storeId,
                                                                  java.util.Locale locale,
                                                                  java.lang.Long rmaId,
                                                                  java.lang.String backendRefundInstructionid,
                                                                  boolean needGlobalized)
                                                           throws J2EEException,
                                                                  InputException
        Method getOverallRefundInstructionStatus.
        Parameters:
        storeId -
        locale -
        rmaId - the identifier of an RMA; with storeId, uniquely identifies an RMA
        backendRefundInstructionid -
        needGlobalized - the flag indicating if the returned status is globalized or not
        Returns:
        a localized, human-readable string describing the refund instruction status in an RMA if needGlobalized is true, otherwise, a nonlocalized string is returned
        Throws:
        J2EEException
        InputException
      • getOverallRmaRefundStatus

        public java.lang.String getOverallRmaRefundStatus(java.lang.Integer storeId,
                                                          java.util.Locale locale,
                                                          CommandContext commandContext,
                                                          java.lang.Long rmaId,
                                                          boolean needGlobalized)
                                                   throws J2EEException,
                                                          InputException

        Obtains the overall payment activity status in an RMA.

        Parameters:
        storeId -
        locale -
        commandContext -
        rmaId - the identifier of an RMA; with storeId, uniquely identifies an RMA
        needGlobalized - the flag indicating if the returned status is globalized or not
        Returns:
        a localized, human-readable string describing the overall payment activity status in an RMA if needGlobalized is true, otherwise, a nonlocalized string is returned
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
      • getPaymentActivityHistory

        public java.util.Collection getPaymentActivityHistory(java.lang.Integer storeId,
                                                              java.util.Locale locale,
                                                              java.lang.String orderChannel,
                                                              CommandContext commandContext,
                                                              java.lang.Long orderOrRmaId,
                                                              boolean details)
                                                       throws InputException,
                                                              J2EEException,
                                                              InternalException,
                                                              ECException

        Finds the payment activity history for an order.

        Parameters:
        storeId -
        locale -
        orderChannel -
        commandContext -
        orderOrRmaId - the order or RMA identifier; it is unique when used with the storeId
        details - whether extra information on an ALR is to be retrieved from the payment backend system
        Returns:
        the payment activity history for a particular order
        Throws:
        InputException - if parameters are invalid (For example: null value)
        J2EEException - if EJBs cannot be accessed appropriately
        InternalException
        ECException
      • getPaymentInstructionActivityHistory

        public java.util.Collection getPaymentInstructionActivityHistory(java.lang.Integer storeId,
                                                                         java.util.Locale locale,
                                                                         java.lang.Long orderId)
                                                                  throws J2EEException,
                                                                         InputException

        Finds the payment instruction activity history for an order.

        Parameters:
        storeId -
        locale -
        orderId - the order identifier; it is unique when used with the storeId
        Returns:
        the payment instruction activity history for a particular order
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
      • getPaymentInstructionsInOrder

        public java.util.Collection getPaymentInstructionsInOrder(java.lang.Integer storeId,
                                                                  java.util.Locale locale,
                                                                  java.lang.String orderChannel,
                                                                  CommandContext commandContext,
                                                                  java.lang.Long orderId,
                                                                  boolean maskSensitiveData)
                                                           throws J2EEException,
                                                                  InputException,
                                                                  CommunicationException

        Obtains a list of Payment Instructions associated to an order.

        Parameters:
        storeId -
        locale -
        orderChannel -
        commandContext -
        orderId - the identifier of the order; with the store id, uniquely identify an order
        maskSensitiveData - if sensitive data should be masked
        Returns:
        the list of Payment Instruction value objects associated to an order
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
        CommunicationException - indicate something very bad happen, problem to communicate to other components
      • getBackendPaymentInstructionInOrder

        public java.util.List getBackendPaymentInstructionInOrder(java.lang.Integer storeId,
                                                                  java.util.Locale locale,
                                                                  java.lang.String orderChannel,
                                                                  CommandContext commandContext,
                                                                  java.lang.Long orderId,
                                                                  boolean maskSensitiveData)
                                                           throws J2EEException,
                                                                  InputException,
                                                                  CommunicationException
        Get the valid backend payment instructions in an order.
        Parameters:
        storeId -
        locale -
        orderChannel -
        commandContext -
        orderId -
        maskSensitiveData -
        Returns:
        list of PaymentInstruction
        Throws:
        J2EEException
        InputException
        CommunicationException
      • getRefundInstructionActivityHistory

        public java.util.Collection getRefundInstructionActivityHistory(java.lang.Integer storeId,
                                                                        java.util.Locale locale,
                                                                        java.lang.Long rmaId)
                                                                 throws J2EEException,
                                                                        InputException

        Finds the refunds instruction activity history for an RMA.

        Parameters:
        storeId -
        locale -
        rmaId - the RMA identifier; it is unique when used with the storeId
        Returns:
        the payment instruction activity history for a particular order
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
      • getRefundInstructionsInRma

        public java.util.Collection getRefundInstructionsInRma(java.lang.Integer storeId,
                                                               java.lang.Long rmaId)
                                                        throws J2EEException,
                                                               InputException

        Obtains a list of Refund Instructions associated to an RMA.

        Parameters:
        storeId -
        rmaId - the identifier of an RMA; with storeId, uniquely identifies an RMA
        Returns:
        the list of Refund Instruction value objects associated to an RMA
        Throws:
        J2EEException - if EJBs cannot be accessed appropriately
        InputException - if parameters are invalid (For example: null value)
      • getUnresolvedFailuresInOrder

        public java.util.Collection getUnresolvedFailuresInOrder(java.lang.Integer storeId,
                                                                 java.util.Locale locale,
                                                                 java.lang.String orderChannel,
                                                                 CommandContext commandContext,
                                                                 java.lang.Long orderId,
                                                                 boolean details)
                                                          throws InputException,
                                                                 J2EEException,
                                                                 InternalException,
                                                                 ECException

        Obtains a list of Activity Log Records (ALR) that contains unresolved failures for an order.

        That last financial operation for each payment instruction is checked. If the operation is not successful, the record of this operation is added to the list of ALRs to be returned.

        Parameters:
        storeId -
        locale -
        orderChannel -
        commandContext -
        orderId - the identifier of the order; with the store id, uniquely identify an order
        details - whether extra information on an ALR is to be retrieved from the payment backend system
        Returns:
        the list of unresolved operations in a particular order
        Throws:
        InputException - if parameters are invalid (For example: null value)
        J2EEException - if EJBs cannot be accessed appropriately
        InternalException
        ECException
      • getUnresolvedFailuresInRma

        public java.util.Collection getUnresolvedFailuresInRma(java.lang.Integer storeId,
                                                               java.util.Locale locale,
                                                               java.lang.String paymentGroupId,
                                                               java.lang.String orderChannel,
                                                               CommandContext commandContext,
                                                               java.lang.Long rmaId,
                                                               boolean details)
                                                        throws InputException,
                                                               J2EEException,
                                                               InternalException,
                                                               ECException

        Obtains a list of Activity Log Records (ALR) that contains unresolved failures for an RMA.

        That last financial operation for each refund instruction is checked. If the operation is not successful, the record of this operation is added to the list of ALRs to be returned.

        Parameters:
        storeId -
        locale -
        paymentGroupId -
        orderChannel -
        commandContext -
        rmaId - the identifier of an RMA; with storeId, uniquely identifies an RMA
        details - whether extra information on an ALR is to be retrieved from the payment backend system
        Returns:
        a list of ALRs with failed or pending operations that have not being resolved yet
        Throws:
        InputException - if parameters are invalid (For example: null value)
        J2EEException - if EJBs cannot be accessed appropriately
        InternalException
        ECException
      • getReleasesInOrder

        public java.util.Collection getReleasesInOrder(java.lang.Integer storeId,
                                                       java.lang.Long orderId)
                                                throws InputException,
                                                       J2EEException

        Obtains a list of payment releases in the order.

        Parameters:
        storeId -
        orderId - the identifier of the order; with the store id, uniquely identify an order
        Returns:
        a list of release databean
        Throws:
        InputException - if parameters are invalid (For example: null value)
        J2EEException - if EJBs cannot be accessed appropriately
      • orderRecordsByDecreasingTimestamp

        public java.util.Collection orderRecordsByDecreasingTimestamp(java.util.Collection inputRecords)

        Sorts a list of Activity Log Records (ALRs) keep the most recently created records first.

        Parameters:
        inputRecords - a non-null list of records to be ordered
        Returns:
        a list of ordered records, most recent records first
      • orderRecordsByDecreasingTimestamp

        public java.util.Collection orderRecordsByDecreasingTimestamp(java.util.Collection inputRecords,
                                                                      java.lang.String payInsID)

        Sorts a list of Activity Log Records (ALRs) of one PI keep the most recently created records first.

        Parameters:
        inputRecords - a non-null list of records to be ordered
        payInsID - a non-null payment instruction ID
        Returns:
        a list of ordered records of the payment instruction, most recent records first
      • getPaymentConfigurationId

        public java.lang.String getPaymentConfigurationId(java.lang.Long policyId)
        get paymentConfigurationId from POLICY table by policy id
        Parameters:
        policyId -
        Returns:
        policyId