Documentation ¶
Index ¶
- type Service
- func (s *Service) AddCommonRateCorrectionRule(ctx context.Context, req *currencies.CommonCorrectionRule, ...) error
- func (s *Service) AddMerchantRateCorrectionRule(ctx context.Context, req *currencies.CorrectionRule, ...) error
- func (s *Service) ExchangeCurrencyByDateCommon(ctx context.Context, req *currencies.ExchangeCurrencyByDateCommonRequest, ...) error
- func (s *Service) ExchangeCurrencyByDateForMerchant(ctx context.Context, req *currencies.ExchangeCurrencyByDateForMerchantRequest, ...) error
- func (s *Service) ExchangeCurrencyCurrentCommon(ctx context.Context, req *currencies.ExchangeCurrencyCurrentCommonRequest, ...) error
- func (s *Service) ExchangeCurrencyCurrentForMerchant(ctx context.Context, req *currencies.ExchangeCurrencyCurrentForMerchantRequest, ...) error
- func (s *Service) GetAccountingCurrencies(ctx context.Context, req *currencies.EmptyRequest, ...) error
- func (s *Service) GetCommonRateCorrectionRule(ctx context.Context, req *currencies.CommonCorrectionRuleRequest, ...) error
- func (s *Service) GetCurrenciesPrecision(ctx context.Context, req *currencies.EmptyRequest, ...) error
- func (s *Service) GetMerchantRateCorrectionRule(ctx context.Context, req *currencies.MerchantCorrectionRuleRequest, ...) error
- func (s *Service) GetPaysuperCorrection(pair string) (float64, error)
- func (s *Service) GetPriceCurrencies(ctx context.Context, req *currencies.EmptyRequest, ...) error
- func (s *Service) GetRateByDateCommon(ctx context.Context, req *currencies.GetRateByDateCommonRequest, ...) error
- func (s *Service) GetRateByDateForMerchant(ctx context.Context, req *currencies.GetRateByDateForMerchantRequest, ...) error
- func (s *Service) GetRateCurrentCommon(ctx context.Context, req *currencies.GetRateCurrentCommonRequest, ...) error
- func (s *Service) GetRateCurrentForMerchant(ctx context.Context, req *currencies.GetRateCurrentForMerchantRequest, ...) error
- func (s *Service) GetSettlementCurrencies(ctx context.Context, req *currencies.EmptyRequest, ...) error
- func (s *Service) GetSupportedCurrencies(ctx context.Context, req *currencies.EmptyRequest, ...) error
- func (s *Service) GetVatCurrencies(ctx context.Context, req *currencies.EmptyRequest, ...) error
- func (s *Service) Init() error
- func (s *Service) RequestRatesCbau() error
- func (s *Service) RequestRatesCbca() error
- func (s *Service) RequestRatesCbeu() error
- func (s *Service) RequestRatesCbpl() error
- func (s *Service) RequestRatesCbrf() error
- func (s *Service) RequestRatesCbtr() error
- func (s *Service) RequestRatesOxr() error
- func (s *Service) SetRatesPaysuper() error
- func (s *Service) SetRatesStock() error
- func (s *Service) Status() (interface{}, error)
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 ¶
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 ¶
func (s *Service) ExchangeCurrencyByDateCommon( ctx context.Context, req *currencies.ExchangeCurrencyByDateCommonRequest, res *currencies.ExchangeCurrencyResponse, ) error
ExchangeCurrencyByDateCommon - exchange currency via rate by date with common correction rule applied
func (*Service) ExchangeCurrencyByDateForMerchant ¶
func (s *Service) ExchangeCurrencyByDateForMerchant( ctx context.Context, req *currencies.ExchangeCurrencyByDateForMerchantRequest, res *currencies.ExchangeCurrencyResponse, ) error
ExchangeCurrencyByDateForMerchant - exchange currency via rate by date with merchant's correction rule applied
func (*Service) ExchangeCurrencyCurrentCommon ¶
func (s *Service) ExchangeCurrencyCurrentCommon( ctx context.Context, req *currencies.ExchangeCurrencyCurrentCommonRequest, res *currencies.ExchangeCurrencyResponse, ) error
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 ¶
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) RequestRatesCbau ¶
RequestRatesCbau - retriving current rates from Central bank of Australia
func (*Service) RequestRatesCbca ¶
RequestRatesCbca - retriving current rates from Central bank of Canada
func (*Service) RequestRatesCbeu ¶
RequestRatesCbeu - retriving current rates from European Central bank
func (*Service) RequestRatesCbpl ¶
RequestRatesCbpl - retriving current rates from Central bank of Poland
func (*Service) RequestRatesCbrf ¶
RequestRatesCbrf - retriving current rates from Central bank of Russia
func (*Service) RequestRatesCbtr ¶ added in v1.3.0
func (*Service) RequestRatesOxr ¶
RequestRatesOxr - retriving current rates from openexchangerates.org
func (*Service) SetRatesPaysuper ¶
SetRatesPaysuper - set prediction rates for Paysuper
func (*Service) SetRatesStock ¶
SetRatesStock - set rates for stock exchange