+source currency pick fix +fx side propagation
This commit is contained in:
@@ -35,7 +35,7 @@ messaging:
|
||||
reconnect_wait: 5
|
||||
buffer_size: 1024
|
||||
|
||||
monetix:
|
||||
mcards:
|
||||
base_url_env: MONETIX_BASE_URL
|
||||
project_id_env: MONETIX_PROJECT_ID
|
||||
secret_key_env: MONETIX_SECRET_KEY
|
||||
@@ -46,7 +46,7 @@ monetix:
|
||||
status_processing: "processing"
|
||||
|
||||
gateway:
|
||||
id: "monetix"
|
||||
id: "mcards"
|
||||
is_enabled: true
|
||||
network: "MIR"
|
||||
currencies: ["RUB"]
|
||||
|
||||
@@ -35,7 +35,7 @@ messaging:
|
||||
reconnect_wait: 5
|
||||
buffer_size: 1024
|
||||
|
||||
monetix:
|
||||
mcards:
|
||||
base_url_env: MONETIX_BASE_URL
|
||||
project_id_env: MONETIX_PROJECT_ID
|
||||
secret_key_env: MONETIX_SECRET_KEY
|
||||
@@ -46,7 +46,7 @@ monetix:
|
||||
status_processing: "processing"
|
||||
|
||||
gateway:
|
||||
id: "monetix"
|
||||
id: "mcards"
|
||||
is_enabled: true
|
||||
network: "MIR"
|
||||
currencies: ["RUB"]
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/tech/sendico/pkg/merrors"
|
||||
msg "github.com/tech/sendico/pkg/messaging"
|
||||
"github.com/tech/sendico/pkg/mlogger"
|
||||
paymenttypes "github.com/tech/sendico/pkg/payments/types"
|
||||
gatewayv1 "github.com/tech/sendico/pkg/proto/common/gateway/v1"
|
||||
"github.com/tech/sendico/pkg/server/grpcapp"
|
||||
"go.uber.org/zap"
|
||||
@@ -41,7 +42,7 @@ type Imp struct {
|
||||
|
||||
type config struct {
|
||||
*grpcapp.Config `yaml:",inline"`
|
||||
Monetix monetixConfig `yaml:"monetix"`
|
||||
Monetix monetixConfig `yaml:"mcards"`
|
||||
Gateway gatewayConfig `yaml:"gateway"`
|
||||
HTTP httpConfig `yaml:"http"`
|
||||
}
|
||||
@@ -216,7 +217,7 @@ func (i *Imp) Start() error {
|
||||
return gatewaymongo.New(logger, conn)
|
||||
}
|
||||
|
||||
app, err := grpcapp.NewApp(i.logger, "monetix", cfg.Config, i.debug, repoFactory, serviceFactory)
|
||||
app, err := grpcapp.NewApp(i.logger, paymenttypes.DefaultCardsGatewayID, cfg.Config, i.debug, repoFactory, serviceFactory)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -275,7 +276,7 @@ func (i *Imp) resolveMonetixConfig(cfg monetixConfig) (monetix.Config, error) {
|
||||
if id, err := strconv.ParseInt(raw, 10, 64); err == nil {
|
||||
projectID = id
|
||||
} else {
|
||||
return monetix.Config{}, merrors.InvalidArgument("invalid project id in env "+cfg.ProjectIDEnv, "monetix.project_id")
|
||||
return monetix.Config{}, merrors.InvalidArgument("invalid project id in env "+cfg.ProjectIDEnv, "mcards.project_id")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -310,7 +311,7 @@ func (i *Imp) resolveMonetixConfig(cfg monetixConfig) (monetix.Config, error) {
|
||||
func resolveGatewayDescriptor(cfg gatewayConfig, monetixCfg monetix.Config) *gatewayv1.GatewayInstanceDescriptor {
|
||||
id := strings.TrimSpace(cfg.ID)
|
||||
if id == "" {
|
||||
id = "monetix"
|
||||
id = paymenttypes.DefaultCardsGatewayID
|
||||
}
|
||||
|
||||
network := strings.ToUpper(strings.TrimSpace(cfg.Network))
|
||||
@@ -444,7 +445,7 @@ func (i *Imp) resolveCallbackConfig(cfg callbackConfig) (callbackRuntimeConfig,
|
||||
}
|
||||
path := strings.TrimSpace(cfg.Path)
|
||||
if path == "" {
|
||||
path = "/monetix/callback"
|
||||
path = "/" + paymenttypes.DefaultCardsGatewayID + "/callback"
|
||||
}
|
||||
maxBody := cfg.MaxBodyBytes
|
||||
if maxBody <= 0 {
|
||||
|
||||
@@ -78,7 +78,7 @@ func (p *cardPayoutProcessor) resolveProjectID(requestProjectID int64, logFieldK
|
||||
}
|
||||
if projectID == 0 {
|
||||
p.logger.Warn("Monetix project_id is not configured", zap.String(logFieldKey, logFieldValue))
|
||||
return 0, merrors.Internal("monetix project_id is not configured")
|
||||
return 0, merrors.Internal("mcards project_id is not configured")
|
||||
}
|
||||
return projectID, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user