Class DefaultPaymentPriorityStrategy

    • Constructor Detail

      • DefaultPaymentPriorityStrategy

        public DefaultPaymentPriorityStrategy()
    • Method Detail

      • sortByPaymentGatewayPriorityForCapture

        public List<PaymentSummary> sortByPaymentGatewayPriorityForCapture​(@Nullable
                                                                           List<PaymentSummary> payments,
                                                                           @Nullable
                                                                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: PaymentPriorityStrategy
        Given a list of PaymentSummaries, sorts them in order of which should be executed first.
        Specified by:
        sortByPaymentGatewayPriorityForCapture in interface PaymentPriorityStrategy
        Parameters:
        payments - the payments to sort
        contextInfo - context information surrounding sandboxing and multitenant state
        Returns:
        a new list representing the sorted result. Will be empty if payments is null or empty.
      • sortByPaymentGatewayPriorityForRefund

        public List<PaymentSummary> sortByPaymentGatewayPriorityForRefund​(@Nullable
                                                                          List<PaymentSummary> payments,
                                                                          @Nullable
                                                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: PaymentPriorityStrategy
        Given a list of PaymentSummaries, sorts them in order of which should be executed first.
        Specified by:
        sortByPaymentGatewayPriorityForRefund in interface PaymentPriorityStrategy
        Parameters:
        payments - the payments to sort
        contextInfo - context information surrounding sandboxing and multitenant state
        Returns:
        a new list representing the sorted result. Will be empty if payments is null or empty.
      • sortByPaymentGatewayPriority

        protected List<PaymentSummary> sortByPaymentGatewayPriority​(BiFunction<String,​String,​List<String>> paymentGatewayPrioritiesGetter,
                                                                    @Nullable
                                                                    List<PaymentSummary> payments,
                                                                    @Nullable
                                                                    com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Sorts the given PaymentSummaries based on the payment gateway priorities.

        The payment priorities are represented by an ordered list of payment gateways using its index, the lower the index, the higher the priority.

        Parameters:
        paymentGatewayPrioritiesGetter - the getter to retrieve the ordered list of payment gateways representing their priorities
        payments - the PaymentSummaries to sort
        contextInfo - context information surrounding sandboxing and multitenant state
        Returns:
        the sorted list of PaymentSummaries
      • getApplicationIdFromContext

        @Nullable
        protected String getApplicationIdFromContext​(@Nullable
                                                     com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • getTenantIdFromContext

        @Nullable
        protected String getTenantIdFromContext​(@Nullable
                                                com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      • setOrderOperationPaymentProperties

        @Autowired
        public void setOrderOperationPaymentProperties​(OrderOperationPaymentProperties orderOperationPaymentProperties)