service

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service is application entry point.

func NewService

func NewService(cfg *config.Config, db *database.Source) (*Service, error)

NewService create new Service.

func (*Service) AddCommonRateCorrectionRule

func (s *Service) AddCommonRateCorrectionRule(
	ctx context.Context,
	req *currencies.CommonCorrectionRule,
	res *currencies.EmptyResponse,
) error

AddCommonRateCorrectionRule - adding new default correction rule for passed rate type

func (*Service) AddMerchantRateCorrectionRule

func (s *Service) AddMerchantRateCorrectionRule(
	ctx context.Context,
	req *currencies.CorrectionRule,
	res *currencies.EmptyResponse,
) error

AddMerchantRateCorrectionRule - adding new merchant's correction rule for passed rate type and merchant id

func (*Service) ExchangeCurrencyByDateCommon

ExchangeCurrencyByDateCommon - exchange currency via rate by date with common correction rule applied

func (*Service) ExchangeCurrencyByDateForMerchant

ExchangeCurrencyByDateForMerchant - exchange currency via rate by date with merchant's correction rule applied

func (*Service) ExchangeCurrencyCurrentCommon

ExchangeCurrencyCurrentCommon - exchange currency via current rate with common correction rule applied

func (*Service) ExchangeCurrencyCurrentForMerchant

func (s *Service) ExchangeCurrencyCurrentForMerchant(
	ctx context.Context,
	req *currencies.ExchangeCurrencyCurrentForMerchantRequest,
	res *currencies.ExchangeCurrencyResponse,
) error

ExchangeCurrencyCurrentForMerchant - exchange currency via current rate with merchant's correction rule applied

func (*Service) GetAccountingCurrencies

func (s *Service) GetAccountingCurrencies(
	ctx context.Context,
	req *currencies.EmptyRequest,
	res *currencies.CurrenciesList,
) error

GetAccountingCurrencies - returns list of settlement accounting currencies

func (*Service) GetCommonRateCorrectionRule

func (s *Service) GetCommonRateCorrectionRule(
	ctx context.Context,
	req *currencies.CommonCorrectionRuleRequest,
	res *currencies.CorrectionRule,
) error

GetCommonRateCorrectionRule - returns common (default) correction rule for passed rate type

func (*Service) GetCurrenciesPrecision added in v1.1.0

func (s *Service) GetCurrenciesPrecision(
	ctx context.Context,
	req *currencies.EmptyRequest,
	res *currencies.CurrenciesPrecisionResponse,
) error

GetCurrenciesPrecision - returns map of currencies with theirs precision

func (*Service) GetMerchantRateCorrectionRule

func (s *Service) GetMerchantRateCorrectionRule(
	ctx context.Context,
	req *currencies.MerchantCorrectionRuleRequest,
	res *currencies.CorrectionRule,
) error

GetMerchantRateCorrectionRule - returns merchant's correction rule for passed rate type, with fallback to common (default) if it not exists

func (*Service) GetPaysuperCorrection

func (s *Service) GetPaysuperCorrection(pair string) (float64, error)

GetPaysuperCorrection - returns paysuper correction value for passed pair of currencies

func (*Service) GetPriceCurrencies

func (s *Service) GetPriceCurrencies(
	ctx context.Context,
	req *currencies.EmptyRequest,
	res *currencies.CurrenciesList,
) error

GetPriceCurrencies - returns list of price currencies

func (*Service) GetRateByDateCommon

func (s *Service) GetRateByDateCommon(
	ctx context.Context,
	req *currencies.GetRateByDateCommonRequest,
	res *currencies.RateData,
) error

GetRateByDateCommon - get rate by date with common correction rule applied

func (*Service) GetRateByDateForMerchant

func (s *Service) GetRateByDateForMerchant(
	ctx context.Context,
	req *currencies.GetRateByDateForMerchantRequest,
	res *currencies.RateData,
) error

GetRateByDateForMerchant - get rate by date with merchant's correction rule applied

func (*Service) GetRateCurrentCommon

func (s *Service) GetRateCurrentCommon(
	ctx context.Context,
	req *currencies.GetRateCurrentCommonRequest,
	res *currencies.RateData,
) error

GetRateCurrentCommon - get current rate with common correction rule applied

func (*Service) GetRateCurrentForMerchant

func (s *Service) GetRateCurrentForMerchant(
	ctx context.Context,
	req *currencies.GetRateCurrentForMerchantRequest,
	res *currencies.RateData,
) error

GetRateCurrentForMerchant - get current rate with merchant's correction rule applied

func (*Service) GetSettlementCurrencies

func (s *Service) GetSettlementCurrencies(
	ctx context.Context,
	req *currencies.EmptyRequest,
	res *currencies.CurrenciesList,
) error

GetSettlementCurrencies - returns list of settlement currencies

func (*Service) GetSupportedCurrencies

func (s *Service) GetSupportedCurrencies(
	ctx context.Context,
	req *currencies.EmptyRequest,
	res *currencies.CurrenciesList,
) error

GetSupportedCurrencies - returns list of all supported currencies

func (*Service) GetVatCurrencies

func (s *Service) GetVatCurrencies(
	ctx context.Context,
	req *currencies.EmptyRequest,
	res *currencies.CurrenciesList,
) error

GetVatCurrencies - returns list of vat currencies

func (*Service) Init

func (s *Service) Init() error

Init rabbitMq brokers and check for active triggers for delayed tasks

func (*Service) RequestRatesCbau

func (s *Service) RequestRatesCbau() error

RequestRatesCbau - retriving current rates from Central bank of Australia

func (*Service) RequestRatesCbca

func (s *Service) RequestRatesCbca() error

RequestRatesCbca - retriving current rates from Central bank of Canada

func (*Service) RequestRatesCbeu

func (s *Service) RequestRatesCbeu() error

RequestRatesCbeu - retriving current rates from European Central bank

func (*Service) RequestRatesCbpl

func (s *Service) RequestRatesCbpl() error

RequestRatesCbpl - retriving current rates from Central bank of Poland

func (*Service) RequestRatesCbrf

func (s *Service) RequestRatesCbrf() error

RequestRatesCbrf - retriving current rates from Central bank of Russia

func (*Service) RequestRatesCbtr added in v1.3.0

func (s *Service) RequestRatesCbtr() error

func (*Service) RequestRatesOxr

func (s *Service) RequestRatesOxr() error

RequestRatesOxr - retriving current rates from openexchangerates.org

func (*Service) SetRatesPaysuper

func (s *Service) SetRatesPaysuper() error

SetRatesPaysuper - set prediction rates for Paysuper

func (*Service) SetRatesStock

func (s *Service) SetRatesStock() error

SetRatesStock - set rates for stock exchange

func (*Service) Status

func (s *Service) Status() (interface{}, error)

Status used to return micro service health.

Jump to

Keyboard shortcuts

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