Interface PaymentCaptureService
- All Known Implementing Classes:
DefaultPaymentCaptureService
public interface PaymentCaptureService
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<TransactionExecutionResponse>
captureFulfillment
(@NonNull javax.money.MonetaryAmount amountToCapture, @NonNull com.broadleafcommerce.order.client.domain.Order order, @NonNull com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated, for removal: This API element is subject to removal in a future version.default List<TransactionExecutionResponse>
captureFulfillmentTotal
(@NonNull com.broadleafcommerce.order.client.domain.Order order, @NonNull com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Responsible for capturing theOrderFulfillment.getGrandTotal()
from theOrder's
paymentsclaimAndCaptureFulfillment
(@NonNull javax.money.MonetaryAmount amountToCapture, @NonNull com.broadleafcommerce.order.client.domain.Order order, @NonNull com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Responsible for claiming and/or capturing an amount from theOrder's
payments.
-
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 theOrder'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 theOrderFulfillment
order
- The order whose payments should be used to claim and/or capture the specified amountfulfillment
- The fulfillment to claim and/or capture payment(s) forcontextInfo
- 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 paymentsPaymentTransactionFailureException
- If a payment capture transaction fails
-
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.since 1.8.0, in favor ofclaimAndCaptureFulfillment(MonetaryAmount, Order, OrderFulfillment, ContextInfo)
Responsible for capturing an amount from theOrder's
payments- Parameters:
amountToCapture
- The amount to capture for theOrderFulfillment
order
- The order whose payments should be used to captured the specified amountfulfillment
- The fulfillment to capture payment forcontextInfo
- 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 paymentsPaymentTransactionFailureException
- 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 theOrderFulfillment.getGrandTotal()
from theOrder's
payments- Parameters:
order
- The order whose payments should be used to captured the specified amountfulfillment
- The fulfillment to capture payment forcontextInfo
- 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 paymentsPaymentTransactionFailureException
- If a payment capture transaction fails
-
claimAndCaptureFulfillment(MonetaryAmount, Order, OrderFulfillment, ContextInfo)