Class MarkPaymentTransactionsForReversalListener

java.lang.Object
com.broadleafcommerce.paymenttransaction.service.messaging.reversals.MarkPaymentTransactionsForReversalListener

@DataRouteByKey("paymentTransaction") @Deprecated(since="1.7.2") public class MarkPaymentTransactionsForReversalListener extends Object
Deprecated.
Listens of events that trigger marking confirmed payments for reversal due to a cart being abandoned during checkout. A payment may be confirmed before checkout is completed successfully and in some cases, the user may have been charged if the implementor has enabled authorize-and-capture (as opposed to authorize) during checkout. Consider the case where there are two payments added to the cart, the first succeeds when confirmed, but the second fails. Checkout has thus failed and the user is presented with an error. If they then abandon their cart, the system needs to reverse the confirmed (captured) payment.
Author:
Nathan Moore (nathandmoore)
  • Field Details

    • MARK_PAYMENTS_FOR_REVERSAL

      public static final String MARK_PAYMENTS_FOR_REVERSAL
      Deprecated.
      See Also:
    • MARK_PAYMENTS_OLDER_THAN_FLD

      public static final String MARK_PAYMENTS_OLDER_THAN_FLD
      Deprecated.
      See Also:
    • BATCH_SIZE_FLD

      public static final String BATCH_SIZE_FLD
      Deprecated.
      See Also:
    • MANAGEMENT_STATES_TO_AVOID

      public static final List<String> MANAGEMENT_STATES_TO_AVOID
      Deprecated.
  • Constructor Details

  • Method Details

    • handle

      @StreamListener("triggeredJobEventInputMarkPaymentTransactionForReversal") public void handle(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message)
      Deprecated.
    • markPaymentsForReversal

      protected void markPaymentsForReversal(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message)
      Deprecated.
      Looks up the payment transactions that should be reversed.
      Parameters:
      message - Contains the scheduled job detail
    • getPaymentsById

      protected Map<String,Payment> getPaymentsById(Set<String> paymentIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated.
      Gets a map of Payments by Payment.getId().

      When reading Payments, a new ContextInfo is built with ContextInfo.isIgnoreNarrowing() set to true, this is done so that this job can mark transactions for reversal even if their payments are archived. The payments should already be tenant discriminated, because their transactions should already be narrowed by specified tenant.

      Parameters:
      paymentIds - the payment ids to look for
      contextInfo - context information related to multitenancy.
      Returns:
      a map of Payments by Payment.getId()
    • markTransactionsForReversal

      protected void markTransactionsForReversal(List<PaymentTransaction> transactions, Map<String,Payment> paymentsById, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated.
      Runs through the provided transactions and marks them with DefaultTransactionManagementStates.REQUIRES_REVERSAL.
    • archiveSingleUsePayment

      protected void archiveSingleUsePayment(@NonNull @NonNull Payment payment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated.
      Archives the Payment that represents a single-use payment method. This in turn, will mark all of its successful transactions with DefaultTransactionManagementStates.REQUIRES_REVERSAL.
      Parameters:
      payment - The payment to archive.
      contextInfo - context information related to multitenancy.
    • markTransactionsForReversal

      protected void markTransactionsForReversal(@NonNull @NonNull Payment payment, @NonNull @NonNull List<PaymentTransaction> transactionsForPayment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated.
    • getOlderThanTime

      protected Instant getOlderThanTime(com.broadleafcommerce.common.messaging.domain.ScheduledJobRef jobRef)
      Deprecated.
      Gets the time older than which a transaction is considered stale.
      Parameters:
      jobRef - Contains the scheduled job detail with this property
      Returns:
      The time older than which a transaction is considered stale.
    • getBatchSize

      protected int getBatchSize(com.broadleafcommerce.common.messaging.domain.ScheduledJobRef jobRef)
      Deprecated.
      Gets the batch size to use when fetching payment transactions. Defaults to 50.
      Parameters:
      jobRef - Contains the scheduled job detail with this property
      Returns:
      The batch size to use when fetching payment transactions
    • getIdempotentService

      protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentService()
      Deprecated.
    • getScheduledJobContextService

      protected com.broadleafcommerce.data.tracking.core.service.scheduledjob.ScheduledJobContextService getScheduledJobContextService()
      Deprecated.
    • getPaymentTransactionService

      protected PaymentTransactionService<PaymentTransaction> getPaymentTransactionService()
      Deprecated.
    • getPaymentService

      protected PaymentService<Payment> getPaymentService()
      Deprecated.
    • getPaymentManagementService

      protected PaymentManagementService<Payment> getPaymentManagementService()
      Deprecated.
    • getPaymentLockService

      protected PaymentLockService<Payment> getPaymentLockService()
      Deprecated.