Class PaymentRefundReturnConfirmedListener


  • public class PaymentRefundReturnConfirmedListener
    extends Object
    Listens for ReturnConfirmedEvent and issues a refund for all pending ReturnConfirmations on the ReturnAuthorization, marking them as completed once finished.

    Delegates to PaymentRefundService.

    Author:
    Samarth Dhruva (samarthd)
    • Constructor Detail

      • PaymentRefundReturnConfirmedListener

        public PaymentRefundReturnConfirmedListener​(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentMessageService,
                                                    PaymentRefundService paymentRefundService,
                                                    OrderProvider<com.broadleafcommerce.order.client.domain.Order> orderProvider,
                                                    ReturnAuthorizationProvider<com.broadleafcommerce.order.client.domain.ReturnAuthorization> returnAuthorizationProvider,
                                                    ResourceLockProvider resourceLockProvider)
    • Method Detail

      • listen

        @StreamListener("orderOperationsReturnConfirmedInput")
        public void listen​(org.springframework.messaging.Message<ReturnConfirmedEvent> message)
      • processEvent

        protected void processEvent​(@NonNull
                                    @NonNull org.springframework.messaging.Message<ReturnConfirmedEvent> message)
      • getOrder

        protected com.broadleafcommerce.order.client.domain.Order getOrder​(@NonNull
                                                                           @NonNull ReturnConfirmedEvent event)
        Get the Order in the event, refreshing in case any payment changes have occurred on the order since the message was emitted.
        Parameters:
        event - the return confirmed event
        Returns:
        the retrieved order based on the event
      • getReturnAuthorization

        protected com.broadleafcommerce.order.client.domain.ReturnAuthorization getReturnAuthorization​(@NonNull
                                                                                                       @NonNull ReturnConfirmedEvent event)
        Get the ReturnAuthorization in the event, refreshing in case any changes have occurred.
        Parameters:
        event - the return confirmed event
        Returns:
        the retrieved return authorization based on the event
      • getIdempotentMessageService

        protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentMessageService()
      • getOrderProvider

        protected OrderProvider<com.broadleafcommerce.order.client.domain.Order> getOrderProvider()
      • getReturnAuthorizationProvider

        protected ReturnAuthorizationProvider<com.broadleafcommerce.order.client.domain.ReturnAuthorization> getReturnAuthorizationProvider()