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 Type
    Method
    Description
    refundAndCompletePendingReturnConfirmations(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 pending ReturnConfirmations on the given ReturnAuthorization (for ReturnAuthorizationItems whose ReturnAuthorizationItem.getReturnType() supports refunds), issues refunds for them, and updates the ReturnConfirmation.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 the OrderFulfillment.
  • 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 pending ReturnConfirmations on the given ReturnAuthorization (for ReturnAuthorizationItems whose ReturnAuthorizationItem.getReturnType() supports refunds), issues refunds for them, and updates the ReturnConfirmation.getStatus() based on the refund responses.
      Parameters:
      order - the order for which the refunds need to be issued
      orderFulfillments - the list of all of the order's fulfillments
      returnAuthWithPendingConfirmations - the return authorization containing pending confirmations that need to be refunded and completed
      contextInfo - 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 the OrderFulfillment.
      Parameters:
      amountToRefund - the amount to refund
      order - the order for which the refund(s) need to be issued
      fulfillment - the fulfillment to refund
      contextInfo - context information surrounding multitenant state
      Returns:
      the updated order
      Throws:
      PaymentRefundException - if there was an error processing the refund(s)