Interface PaymentPriorityStrategy

All Known Implementing Classes:
DefaultPaymentPriorityStrategy

public interface PaymentPriorityStrategy
A helper component that has understanding of which PaymentSummaries take precedence and should be applied first in various operations such as payment capture, reverse authorize, and refund.
Author:
Samarth Dhruva (samarthd), Sunny Yu
  • Method Details

    • sortByPaymentGatewayPriorityForCapture

      List<PaymentSummary> sortByPaymentGatewayPriorityForCapture(List<PaymentSummary> payments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Given a list of PaymentSummaries, sorts them in order of which should be executed first.
      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

      List<PaymentSummary> sortByPaymentGatewayPriorityForRefund(List<PaymentSummary> payments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Given a list of PaymentSummaries, sorts them in order of which should be executed first.
      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.
    • sortByPaymentGatewayPriorityForCancelFulfillment

      default List<PaymentSummary> sortByPaymentGatewayPriorityForCancelFulfillment(@Nullable List<PaymentSummary> payments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Given a list of PaymentSummaries, sorts them in order of which should be refunded or reversed first when the fulfillment is cancelled. The default implementation is added for backward compatibility, and this method should also be implemented when this interface is implemented.
      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.
    • sortByRefundPriority

      @Deprecated List<PaymentSummary> sortByRefundPriority(@Nullable List<PaymentSummary> payments)
      Deprecated.
      Given a list of PaymentSummaries, sorts them in order of which should be refunded first.
      Parameters:
      payments - the payments to sort
      Returns:
      a new list representing the sorted result. Will be empty if payments is null or empty.