Interface PaymentRefundService
- All Known Implementing Classes:
DefaultPaymentRefundService
public interface PaymentRefundService
A service responsible for issuing refunds for an
Order
's payments.- Author:
- Samarth Dhruva (samarthd)
-
Method Summary
Modifier and TypeMethodDescriptionrefundAndCompletePendingReturnConfirmations
(com.broadleafcommerce.order.client.domain.Order order, List<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillments, com.broadleafcommerce.order.client.domain.ReturnAuthorization returnAuthWithPendingConfirmations, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all pendingReturnConfirmations
on the givenReturnAuthorization
(forReturnAuthorizationItems
whoseReturnAuthorizationItem.getReturnType()
supports refunds), issues refunds for them, and updates theReturnConfirmation.getStatus()
based on the refund responses.refundFulfillment
(javax.money.MonetaryAmount amountToRefund, com.broadleafcommerce.order.client.domain.Order order, com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Issues refund(s) for the given amount for theOrderFulfillment
.
-
Method Details
-
refundAndCompletePendingReturnConfirmations
List<TransactionExecutionResponse> refundAndCompletePendingReturnConfirmations(com.broadleafcommerce.order.client.domain.Order order, List<com.broadleafcommerce.order.client.domain.OrderFulfillment> orderFulfillments, com.broadleafcommerce.order.client.domain.ReturnAuthorization returnAuthWithPendingConfirmations, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds all pendingReturnConfirmations
on the givenReturnAuthorization
(forReturnAuthorizationItems
whoseReturnAuthorizationItem.getReturnType()
supports refunds), issues refunds for them, and updates theReturnConfirmation.getStatus()
based on the refund responses.- Parameters:
order
- the order for which the refunds need to be issuedorderFulfillments
- the list of all of the order's fulfillmentsreturnAuthWithPendingConfirmations
- the return authorization containing pending confirmations that need to be refunded and completedcontextInfo
- context information surrounding multitenant state- Returns:
- the updated order, or
null
if there were no pending return confirmations on the return authorization - Throws:
PaymentRefundException
- if there was an error processing the refund(s)
-
refundFulfillment
List<TransactionExecutionResponse> refundFulfillment(javax.money.MonetaryAmount amountToRefund, com.broadleafcommerce.order.client.domain.Order order, com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Issues refund(s) for the given amount for theOrderFulfillment
.- Parameters:
amountToRefund
- the amount to refundorder
- the order for which the refund(s) need to be issuedfulfillment
- the fulfillment to refundcontextInfo
- context information surrounding multitenant state- Returns:
- the updated order
- Throws:
PaymentRefundException
- if there was an error processing the refund(s)
-