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 Summary
-
Constructor Summary
ConstructorDescriptionMarkPaymentTransactionsForReversalListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentService, com.broadleafcommerce.data.tracking.core.service.scheduledjob.ScheduledJobContextService scheduledJobContextService, PaymentTransactionService<PaymentTransaction> paymentTransactionService, PaymentService<Payment> paymentService, PaymentManagementService<Payment> paymentManagementService, PaymentLockService<Payment> paymentLockService) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
archiveSingleUsePayment
(@NonNull Payment payment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Archives thePayment
that represents a single-use payment method.protected int
getBatchSize
(com.broadleafcommerce.common.messaging.domain.ScheduledJobRef jobRef) Deprecated.Gets the batch size to use when fetching payment transactions.protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
Deprecated.protected Instant
getOlderThanTime
(com.broadleafcommerce.common.messaging.domain.ScheduledJobRef jobRef) Deprecated.Gets the time older than which a transaction is considered stale.protected PaymentLockService<Payment>
Deprecated.protected PaymentManagementService<Payment>
Deprecated.getPaymentsById
(Set<String> paymentIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Gets a map ofPayments
byPayment.getId()
.protected PaymentService<Payment>
Deprecated.protected PaymentTransactionService<PaymentTransaction>
Deprecated.protected com.broadleafcommerce.data.tracking.core.service.scheduledjob.ScheduledJobContextService
Deprecated.void
handle
(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Deprecated.protected void
markPaymentsForReversal
(org.springframework.messaging.Message<com.broadleafcommerce.common.messaging.domain.ScheduledJobRef> message) Deprecated.Looks up the payment transactions that should be reversed.protected void
markTransactionsForReversal
(@NonNull Payment payment, @NonNull List<PaymentTransaction> transactionsForPayment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.protected void
markTransactionsForReversal
(List<PaymentTransaction> transactions, Map<String, Payment> paymentsById, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Runs through the provided transactions and marks them withDefaultTransactionManagementStates.REQUIRES_REVERSAL
.
-
Field Details
-
MARK_PAYMENTS_FOR_REVERSAL
Deprecated.- See Also:
-
MARK_PAYMENTS_OLDER_THAN_FLD
Deprecated.- See Also:
-
BATCH_SIZE_FLD
Deprecated.- See Also:
-
MANAGEMENT_STATES_TO_AVOID
Deprecated.
-
-
Constructor Details
-
MarkPaymentTransactionsForReversalListener
public MarkPaymentTransactionsForReversalListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentService, com.broadleafcommerce.data.tracking.core.service.scheduledjob.ScheduledJobContextService scheduledJobContextService, PaymentTransactionService<PaymentTransaction> paymentTransactionService, PaymentService<Payment> paymentService, PaymentManagementService<Payment> paymentManagementService, PaymentLockService<Payment> paymentLockService) Deprecated.
-
-
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 ofPayments
byPayment.getId()
.When reading
Payments
, a newContextInfo
is built withContextInfo.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
- thepayment ids
to look forcontextInfo
- context information related to multitenancy.- Returns:
- a map of
Payments
byPayment.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 withDefaultTransactionManagementStates.REQUIRES_REVERSAL
. -
archiveSingleUsePayment
protected void archiveSingleUsePayment(@NonNull @NonNull Payment payment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deprecated.Archives thePayment
that represents a single-use payment method. This in turn, will mark all of its successful transactions withDefaultTransactionManagementStates.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
Deprecated. -
getPaymentService
Deprecated. -
getPaymentManagementService
Deprecated. -
getPaymentLockService
Deprecated.
-
CheckoutRollbackEventListener