temp build
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
mntxservice "github.com/tech/sendico/gateway/mntx/internal/service/gateway"
|
||||
"github.com/tech/sendico/gateway/mntx/internal/service/monetix"
|
||||
"github.com/tech/sendico/pkg/api/routers"
|
||||
"github.com/tech/sendico/pkg/merrors"
|
||||
msg "github.com/tech/sendico/pkg/messaging"
|
||||
@@ -168,7 +169,7 @@ func (i *Imp) loadConfig() (*config, error) {
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
func (i *Imp) resolveMonetixConfig(cfg monetixConfig) (mntxservice.MonetixConfig, error) {
|
||||
func (i *Imp) resolveMonetixConfig(cfg monetixConfig) (monetix.Config, error) {
|
||||
baseURL := strings.TrimSpace(cfg.BaseURL)
|
||||
if env := strings.TrimSpace(cfg.BaseURLEnv); env != "" {
|
||||
if val := strings.TrimSpace(os.Getenv(env)); val != "" {
|
||||
@@ -183,7 +184,7 @@ func (i *Imp) resolveMonetixConfig(cfg monetixConfig) (mntxservice.MonetixConfig
|
||||
if id, err := strconv.ParseInt(raw, 10, 64); err == nil {
|
||||
projectID = id
|
||||
} else {
|
||||
return mntxservice.MonetixConfig{}, merrors.InvalidArgument("invalid project id in env "+cfg.ProjectIDEnv, "monetix.project_id")
|
||||
return monetix.Config{}, merrors.InvalidArgument("invalid project id in env "+cfg.ProjectIDEnv, "monetix.project_id")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -203,7 +204,7 @@ func (i *Imp) resolveMonetixConfig(cfg monetixConfig) (mntxservice.MonetixConfig
|
||||
statusSuccess := strings.TrimSpace(cfg.StatusSuccess)
|
||||
statusProcessing := strings.TrimSpace(cfg.StatusProcessing)
|
||||
|
||||
return mntxservice.MonetixConfig{
|
||||
return monetix.Config{
|
||||
BaseURL: baseURL,
|
||||
ProjectID: projectID,
|
||||
SecretKey: secret,
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/tech/sendico/pkg/merrors"
|
||||
"github.com/tech/sendico/pkg/mlogger"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
@@ -31,7 +30,7 @@ func NewClient(cfg Config, httpClient *http.Client, logger mlogger.Logger) *Clie
|
||||
return &Client{
|
||||
cfg: cfg,
|
||||
client: client,
|
||||
logger: cl.Named("monetix_client"),
|
||||
logger: cl.Named("client"),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,8 +64,10 @@ func (t *PaymentType) UnmarshalJSON(data []byte) error {
|
||||
|
||||
type PaymentMethod struct {
|
||||
PermissionBound `bson:",inline" json:",inline"`
|
||||
Describable `bson:",inline" json:",inline"`
|
||||
|
||||
RecipientRef primitive.ObjectID `bson:"recipientRef" json:"recipientRef"`
|
||||
Type PaymentType `bson:"type" json:"type"`
|
||||
Data bson.Raw `bson:"data" json:"data"`
|
||||
IsMain bool `bson:"isMain" json:"isMain"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user