payments

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RabbitMQExchangeName = "payments"
	RabbitMQExchangeType = "topic"
	RabbitMQRoutingKey   = "payments.events"
)

Variables

This section is empty.

Functions

func NewProcessor

func NewProcessor(messageConsumer messages.Consumer, eventsHandler EventsHandler, opts ...messages.ProcessorOpt) *messages.Processor[EventsHandler]

NewProcessor returns a messages.Processor which is specific to payments events

func NewRabbitMQProcessor

func NewRabbitMQProcessor(
	eventsHandler EventsHandler,
	queueName string,
	opts ...RabbitMQProcessorOpt,
) (*messages.Processor[EventsHandler], error)

Types

type BeneficiaryAccount

type BeneficiaryAccount struct {
	Holder     string `json:"holder"`
	Number     int    `json:"number"`
	RoutingKey string `json:"routing_key"`
}

type EventsDeserializer

type EventsDeserializer struct {
}

func NewEventsDeserializer

func NewEventsDeserializer() *EventsDeserializer

func (*EventsDeserializer) Deserialize

func (d *EventsDeserializer) Deserialize(rawPayload []byte) (events.Event[EventsHandler], error)

type EventsHandler added in v0.0.8

type EventsHandler interface {
	HandleWithdrawalCreated(ctx context.Context, withdrawalCreated WithdrawalCreatedEvent) errors.ProcessingError
}

type RabbitMQProcessorOpt added in v0.0.5

type RabbitMQProcessorOpt struct {
	ProcessorOpt        messages.ProcessorOpt
	RabbitmqConsumerOpt rabbitmq.ConsumerOpt
}

type WithdrawalBeneficiary

type WithdrawalBeneficiary struct {
	Id          string             `json:"id"`
	Description string             `json:"description"`
	Account     BeneficiaryAccount `json:"account"`
}

type WithdrawalCreatedEvent

type WithdrawalCreatedEvent struct {
	Id          string                `json:"id"`
	UserId      string                `json:"user_id"`
	PspId       string                `json:"psp_id"`
	ExternalId  string                `json:"external_id"`
	Amount      float64               `json:"amount"`
	Currency    string                `json:"currency"`
	Status      string                `json:"status"`
	Beneficiary WithdrawalBeneficiary `json:"beneficiary"`
	// contains filtered or unexported fields
}

func (WithdrawalCreatedEvent) Accept

func (WithdrawalCreatedEvent) CorrelationID added in v0.0.5

func (w WithdrawalCreatedEvent) CorrelationID() string

func (WithdrawalCreatedEvent) DataContentType

func (w WithdrawalCreatedEvent) DataContentType() string

func (WithdrawalCreatedEvent) ID

func (WithdrawalCreatedEvent) Serialize

func (w WithdrawalCreatedEvent) Serialize() ([]byte, error)

func (WithdrawalCreatedEvent) Type

func (w WithdrawalCreatedEvent) Type() string

Jump to

Keyboard shortcuts

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