acquirer

package
v0.0.0-...-66e3c94 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = fmt.Errorf("not found")

Functions

This section is empty.

Types

type API

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

func NewAPI

func NewAPI(logger *slog.Logger, acquirer *Service) *API

func (*API) AppendRoutes

func (a *API) AppendRoutes(r chi.Router)

type App

type App struct {
	Addr              string
	ISO8583ServerAddr string
	// contains filtered or unexported fields
}

App is the main application, it contains all the components of the issuer service and is responsible for starting and stopping them.

func NewApp

func NewApp(logger *slog.Logger, config *Config) *App

func (*App) Shutdown

func (a *App) Shutdown()

func (*App) Start

func (a *App) Start() error

type Config

type Config struct {
	HTTPAddr    string
	ISO8583Addr string
}

func DefaultConfig

func DefaultConfig() *Config

type ISO8583Client

type ISO8583Client interface {
	AuthorizePayment(payment *models.Payment, card models.Card, merchant models.Merchant) (models.AuthorizationResponse, error)
}

type Repository

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

func NewRepository

func NewRepository() *Repository

func (*Repository) CreateMerchant

func (r *Repository) CreateMerchant(merchant *models.Merchant) error

func (*Repository) CreatePayment

func (r *Repository) CreatePayment(payment *models.Payment) error

func (*Repository) GetMerchant

func (r *Repository) GetMerchant(merchantID string) (*models.Merchant, error)

func (*Repository) GetPayment

func (r *Repository) GetPayment(merchantID, paymentID string) (*models.Payment, error)

type Service

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

func NewService

func NewService(repo *Repository, iso8583Client ISO8583Client) *Service

func (*Service) CreateMerchant

func (a *Service) CreateMerchant(create models.CreateMerchant) (*models.Merchant, error)

func (*Service) CreatePayment

func (a *Service) CreatePayment(merchantID string, create models.CreatePayment) (*models.Payment, error)

func (*Service) GetPayment

func (a *Service) GetPayment(merchantID, paymentID string) (*models.Payment, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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