Interface PaymentCaptureService
- All Known Implementing Classes:
DefaultPaymentCaptureService
public interface PaymentCaptureService
-
Method Summary
Modifier and TypeMethodDescriptiondefault List<TransactionExecutionResponse>autoCapturePaymentsIfNecessary(com.broadleafcommerce.order.client.domain.Order order, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) This method is used to auto-capture payments for the gateway types specified inOrderOperationPaymentProperties.getAutoCapturePaymentGateways(String, String)list.default 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'spaymentsclaimAndCaptureFulfillment(@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'spayments.
-
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'spayments.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 theOrderFulfillmentorder- 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
CaptureFulfillmentResultcontaining 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
-
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 inOrderOperationPaymentProperties.getAutoCapturePaymentGateways(String, String)list.- Parameters:
order- The order whose payments should be used to capture the auto paymentcontextInfo- Context information around sandbox and multitenant state- Returns:
- the
TransactionExecutionResponsesfor 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.since 1.8.0, in favor ofclaimAndCaptureFulfillment(MonetaryAmount, Order, OrderFulfillment, ContextInfo)Responsible for capturing an amount from theOrder'spayments- Parameters:
amountToCapture- The amount to capture for theOrderFulfillmentorder- 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
TransactionExecutionResponsesfor 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'spayments- 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
TransactionExecutionResponsesfor 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)