Versions in this module Expand all Collapse all v0 v0.6.0 Dec 17, 2023 v0.5.6 Dec 16, 2023 v0.5.5 Dec 8, 2023 v0.5.4 Sep 28, 2023 v0.5.3 Sep 27, 2023 v0.5.2 Sep 5, 2023 v0.5.1 Aug 17, 2023 v0.5.0 Jul 29, 2023 v0.4.0 Jul 27, 2023 v0.3.1 Jul 25, 2023 v0.3.0 Jul 23, 2023 v0.2.0 Jul 9, 2023 v0.1.3 Jul 2, 2023 v0.1.2 Jul 2, 2023 v0.1.1 Jul 2, 2023 v0.1.0 Jun 25, 2023 Changes in this version + const PropertyPaymentMethods + const PropertySignatureSecret + const PropertyWebhookURL + var ErrAddressAlreadyExists = errors.New("merchant address already exists") + var ErrAddressNotFound = errors.New("merchant address not found") + var ErrAddressReserved = errors.New("this address is reserved") + var ErrMerchantNotFound = errors.New("merchant not found") + type Address struct + Address string + Blockchain wallet.Blockchain + BlockchainName string + CreatedAt time.Time + ID int64 + MerchantID int64 + Name string + UUID uuid.UUID + UpdatedAt time.Time + type BlockchainService interface + type CreateMerchantAddressParams struct + Address string + Blockchain wallet.Blockchain + Name string + type Merchant struct + CreatedAt time.Time + CreatorID int64 + ID int64 + Name string + UUID uuid.UUID + UpdatedAt time.Time + Website string + func (m *Merchant) Settings() Settings + type Property string + type Service struct + func New(repo *repository.Queries, blockchainService BlockchainService, ...) *Service + func (s *Service) Create(ctx context.Context, creatorID int64, name, website string, settings Settings) (*Merchant, error) + func (s *Service) CreateMerchantAddress(ctx context.Context, merchantID int64, params CreateMerchantAddressParams) (*Address, error) + func (s *Service) DeleteByUUID(ctx context.Context, merchantUUID uuid.UUID) error + func (s *Service) DeleteMerchantAddress(ctx context.Context, merchantID int64, id uuid.UUID) error + func (s *Service) GetByID(ctx context.Context, id int64, withTrashed bool) (*Merchant, error) + func (s *Service) GetByUUIDAndCreatorID(ctx context.Context, merchantUUID uuid.UUID, creatorID int64, withTrashed bool) (*Merchant, error) + func (s *Service) GetMerchantAddressByID(ctx context.Context, merchantID, id int64) (*Address, error) + func (s *Service) GetMerchantAddressByUUID(ctx context.Context, merchantID int64, id uuid.UUID) (*Address, error) + func (s *Service) ListByCreatorID(ctx context.Context, creatorID int64) ([]*Merchant, error) + func (s *Service) ListMerchantAddresses(ctx context.Context, merchantID int64) ([]*Address, error) + func (s *Service) ListSupportedCurrencies(_ context.Context, merchant *Merchant) ([]SupportedCurrency, error) + func (s *Service) Update(ctx context.Context, id int64, name, website string) (*Merchant, error) + func (s *Service) UpdateMerchantAddress(ctx context.Context, merchantID int64, id uuid.UUID, name string) (*Address, error) + func (s *Service) UpdateSupportedMethods(ctx context.Context, merchant *Merchant, tickers []string) error + func (s *Service) UpsertSettings(ctx context.Context, merchant *Merchant, settings Settings) error + type Settings map[Property]string + func (s Settings) PaymentMethods() []string + func (s Settings) WebhookSignatureSecret() string + func (s Settings) WebhookURL() string + type SupportedCurrency struct + Currency money.CryptoCurrency + Enabled bool