Documentation
¶
Index ¶
- func HandleCompleted(bus eventbus.Bus, uow repository.UnitOfWork, logger *slog.Logger) func(ctx context.Context, e events.Event) error
- func HandleFailed(bus eventbus.Bus, uow repository.UnitOfWork, logger *slog.Logger) eventbus.HandlerFunc
- func HandleInitiated(bus eventbus.Bus, paymentProvider payment.Payment, logger *slog.Logger) eventbus.HandlerFunc
- func HandleProcessed(uow repository.UnitOfWork, logger *slog.Logger) eventbus.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleCompleted ¶
func HandleCompleted( bus eventbus.Bus, uow repository.UnitOfWork, logger *slog.Logger, ) func( ctx context.Context, e events.Event, ) error
HandleCompleted handles PaymentCompletedEvent, updates the transaction status in the DB, and publishes a follow-up event if needed.
func HandleFailed ¶ added in v1.2.0
func HandleFailed( bus eventbus.Bus, uow repository.UnitOfWork, logger *slog.Logger, ) eventbus.HandlerFunc
HandleFailed handles the PaymentFailedEvent by updating the transaction status to "failed"
func HandleInitiated ¶
func HandleInitiated( bus eventbus.Bus, paymentProvider payment.Payment, logger *slog.Logger, ) eventbus.HandlerFunc
HandleInitiated handles DepositBusinessValidatedEvent and initiates payment for deposits.
func HandleProcessed ¶
func HandleProcessed( uow repository.UnitOfWork, logger *slog.Logger, ) eventbus.HandlerFunc
HandleProcessed handles PaymentInitiatedEvent and updates the transaction with payment ID. This is a generic handler that can process payment events for all operations (deposit, withdraw, transfer).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.