Skip to content

Finalizers

Finalizers are an opportunity to do work or enhance an object right before it is saved and "finalized." The prime example is the IFinalizeSaleSessionListener.

Many times the sale session finalizer will be used to schedule work queue items that need to be resilient and need to run after the sale has finished. Some examples are:

  • Calling a custom web service to mark a single-use coupon as used.
  • Setting a flag on the transaction to mark it as ready to process after an amount of time has passed.
  • Setting custom fields on the transaction for downstream processing.

Best Practices

  • Make sure to catch and handle errors.

Anti-patterns

  • Not provided.