withdraw

package
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleCurrencyConverted

func HandleCurrencyConverted(
	bus eventbus.Bus,
	uow repository.UnitOfWork,
	logger *slog.Logger,
) func(
	ctx context.Context,
	e events.Event,
) error

HandleCurrencyConverted performs domain validation after currency conversion for withdrawals. Emits WithdrawBusinessValidated event to trigger payment initiation.

func HandleRequested

func HandleRequested(
	bus eventbus.Bus,
	uow repository.UnitOfWork,
	logger *slog.Logger,
) func(
	ctx context.Context,
	e events.Event,
) error

HandleRequested handles WithdrawRequested events by validating and persisting the withdraw. This follows the new event flow pattern: Requested -> HandleRequested (validate and persist).

func HandleValidated added in v1.4.0

func HandleValidated(
	bus eventbus.Bus,
	uow repository.UnitOfWork,
	paymentProvider payment.Payment,
	logger *slog.Logger,
) eventbus.HandlerFunc

HandleValidated handles WithdrawValidated events by initiating a payout. It's responsible for starting the external payout process to the user's connected account. The function follows these steps: 1. Validates the withdrawal request 2. Retrieves user's Stripe Connect account 3. Prepares and initiates the payout 4. Emits appropriate events for the transaction lifecycle

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL