Interface PaymentCaptureService

All Known Implementing Classes:
DefaultPaymentCaptureService

public interface PaymentCaptureService
  • Method Details

    • claimAndCaptureFulfillment

      CaptureFulfillmentResult claimAndCaptureFulfillment(@NonNull @NonNull javax.money.MonetaryAmount amountToCapture, @NonNull @NonNull com.broadleafcommerce.order.client.domain.Order order, @NonNull @NonNull com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Responsible for claiming and/or capturing an amount from the Order's payments.

      If there are payments already captured during the checkout flow, meaning the checkout transaction type was DefaultTransactionTypes.AUTHORIZE_AND_CAPTURE, this method will claim those captured amounts instead of executing unnecessary capture transactions.

      In a multi-payment scenario with different checkout transaction types, there may be a mixture of claiming and executing the capture transactions for a single OrderFulfillment.

      Parameters:
      amountToCapture - The amount to claim and/or capture for the OrderFulfillment
      order - The order whose payments should be used to claim and/or capture the specified amount
      fulfillment - The fulfillment to claim and/or capture payment(s) for
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      the CaptureFulfillmentResult containing details about how the fulfillment was claimed and/or captured
      Throws:
      PaymentCaptureException - If the totalToCapture is too high and cannot be handled by the order's payments
      PaymentTransactionFailureException - If a payment capture transaction fails
    • autoCapturePaymentsIfNecessary

      default List<TransactionExecutionResponse> autoCapturePaymentsIfNecessary(com.broadleafcommerce.order.client.domain.Order order, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      This method is used to auto-capture payments for the gateway types specified in OrderOperationPaymentProperties.getAutoCapturePaymentGateways(String, String) list.
      Parameters:
      order - The order whose payments should be used to capture the auto payment
      contextInfo - Context information around sandbox and multitenant state
      Returns:
      the TransactionExecutionResponses for all the capture transactions
    • captureFulfillment

      @Deprecated(since="1.8.0", forRemoval=true) default List<TransactionExecutionResponse> captureFulfillment(@NonNull @NonNull javax.money.MonetaryAmount amountToCapture, @NonNull @NonNull com.broadleafcommerce.order.client.domain.Order order, @NonNull @NonNull com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Responsible for capturing an amount from the Order's payments
      Parameters:
      amountToCapture - The amount to capture for the OrderFulfillment
      order - The order whose payments should be used to captured the specified amount
      fulfillment - The fulfillment to capture payment for
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      the TransactionExecutionResponses for all the capture transactions
      Throws:
      PaymentCaptureException - If the totalToCapture is too high and cannot be handled by the order's payments
      PaymentTransactionFailureException - If a payment capture transaction fails
    • captureFulfillmentTotal

      default List<TransactionExecutionResponse> captureFulfillmentTotal(@NonNull @NonNull com.broadleafcommerce.order.client.domain.Order order, @NonNull @NonNull com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Responsible for capturing the OrderFulfillment.getGrandTotal() from the Order's payments
      Parameters:
      order - The order whose payments should be used to captured the specified amount
      fulfillment - The fulfillment to capture payment for
      contextInfo - Context information around sandbox and multitenant state.
      Returns:
      the TransactionExecutionResponses for all the capture transactions
      Throws:
      PaymentCaptureException - If the totalToCapture is too high and cannot be handled by the order's payments
      PaymentTransactionFailureException - If a payment capture transaction fails