payment

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractPaymentCompletedKey added in v1.5.0

func ExtractPaymentCompletedKey(e events.Event) string

ExtractPaymentCompletedKey extracts idempotency key from PaymentCompleted event

func ExtractPaymentInitiatedKey added in v1.5.0

func ExtractPaymentInitiatedKey(e events.Event) string

ExtractPaymentInitiatedKey extracts idempotency key from PaymentInitiated event

func ExtractPaymentProcessedKey added in v1.5.0

func ExtractPaymentProcessedKey(e events.Event) string

ExtractPaymentProcessedKey extracts idempotency key from PaymentProcessed event

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.

Jump to

Keyboard shortcuts

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