ledger account reference removed
This commit is contained in:
@@ -46,6 +46,7 @@ type config struct {
|
||||
Gateway clientConfig `yaml:"gateway"`
|
||||
Oracle clientConfig `yaml:"oracle"`
|
||||
CardGateways map[string]cardGatewayRouteConfig `yaml:"card_gateways"`
|
||||
FeeAccounts map[string]string `yaml:"fee_ledger_accounts"`
|
||||
}
|
||||
|
||||
type clientConfig struct {
|
||||
@@ -159,6 +160,9 @@ func (i *Imp) Start() error {
|
||||
if routes := buildCardGatewayRoutes(cfg.CardGateways); len(routes) > 0 {
|
||||
opts = append(opts, orchestrator.WithCardGatewayRoutes(routes))
|
||||
}
|
||||
if feeAccounts := buildFeeLedgerAccounts(cfg.FeeAccounts); len(feeAccounts) > 0 {
|
||||
opts = append(opts, orchestrator.WithFeeLedgerAccounts(feeAccounts))
|
||||
}
|
||||
return orchestrator.NewService(logger, repo, opts...), nil
|
||||
}
|
||||
|
||||
@@ -323,3 +327,19 @@ func buildCardGatewayRoutes(src map[string]cardGatewayRouteConfig) map[string]or
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func buildFeeLedgerAccounts(src map[string]string) map[string]string {
|
||||
if len(src) == 0 {
|
||||
return nil
|
||||
}
|
||||
result := make(map[string]string, len(src))
|
||||
for key, account := range src {
|
||||
k := strings.ToLower(strings.TrimSpace(key))
|
||||
v := strings.TrimSpace(account)
|
||||
if k == "" || v == "" {
|
||||
continue
|
||||
}
|
||||
result[k] = v
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user