payment

package
v0.0.0-...-19dc864 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PaymentConsumer

type PaymentConsumer struct {
	// contains filtered or unexported fields
}

PaymentConsumer represents payment Kafka consumer

func NewPaymentConsumer

func NewPaymentConsumer(brokers []string, groupID string, useCase *PaymentUseCase, logger *zerolog.Logger) *PaymentConsumer

NewPaymentConsumer creates new payment consumer

func (*PaymentConsumer) Start

func (pc *PaymentConsumer) Start(ctx context.Context) error

Start starts the payment consumer

func (*PaymentConsumer) Stop

func (pc *PaymentConsumer) Stop() error

Stop stops the payment consumer

type PaymentUseCase

type PaymentUseCase struct {
	// contains filtered or unexported fields
}

PaymentUseCase represents payment use case

func NewPaymentUseCase

func NewPaymentUseCase(paymentRepo *persistent.PaymentRepo, kafkaProd *kafka.Producer, logger *zerolog.Logger) *PaymentUseCase

NewPaymentUseCase creates new payment use case

func (*PaymentUseCase) GetPaymentByID

func (uc *PaymentUseCase) GetPaymentByID(ctx context.Context, id int64) (*entity.PaymentResponse, error)

GetPaymentByID gets payment by ID

func (*PaymentUseCase) GetPaymentsByUserID

func (uc *PaymentUseCase) GetPaymentsByUserID(ctx context.Context, userID int64) ([]*entity.PaymentResponse, error)

GetPaymentsByUserID gets payments by user ID

func (*PaymentUseCase) ProcessPayment

func (uc *PaymentUseCase) ProcessPayment(ctx context.Context, paymentEvent *entity.PaymentEvent) error

ProcessPayment processes payment from Kafka message

func (*PaymentUseCase) RegisterPayment

func (uc *PaymentUseCase) RegisterPayment(ctx context.Context, req *entity.PaymentRequest) (*entity.PaymentResponse, error)

RegisterPayment registers a new payment and sends to Kafka

Jump to

Keyboard shortcuts

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