new payment by id method + shell scripts update + mntx removed
This commit is contained in:
@@ -43,7 +43,7 @@ type gatewayClient struct {
|
||||
func New(ctx context.Context, cfg Config, opts ...grpc.DialOption) (Client, error) {
|
||||
cfg.setDefaults()
|
||||
if strings.TrimSpace(cfg.Address) == "" {
|
||||
return nil, merrors.InvalidArgument("mntx: address is required")
|
||||
return nil, merrors.InvalidArgument("mcards: address is required")
|
||||
}
|
||||
dialOpts := make([]grpc.DialOption, 0, len(opts)+1)
|
||||
dialOpts = append(dialOpts, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
@@ -51,7 +51,7 @@ func New(ctx context.Context, cfg Config, opts ...grpc.DialOption) (Client, erro
|
||||
|
||||
conn, err := grpc.NewClient(cfg.Address, dialOpts...)
|
||||
if err != nil {
|
||||
return nil, merrors.Internal("mntx: dial failed: " + err.Error())
|
||||
return nil, merrors.Internal("mcards: dial failed: " + err.Error())
|
||||
}
|
||||
|
||||
return &gatewayClient{
|
||||
@@ -128,7 +128,7 @@ func (g *gatewayClient) GetCardPayoutStatus(ctx context.Context, req *mntxv1.Get
|
||||
ctx, cancel := g.callContext(ctx, "GetCardPayoutStatus")
|
||||
defer cancel()
|
||||
if req == nil || strings.TrimSpace(req.GetPayoutId()) == "" {
|
||||
return nil, merrors.InvalidArgument("mntx: payout_id is required")
|
||||
return nil, merrors.InvalidArgument("mcards: payout_id is required")
|
||||
}
|
||||
resp, err := g.client.GetOperation(ctx, &connectorv1.GetOperationRequest{OperationId: strings.TrimSpace(req.GetPayoutId())})
|
||||
if err != nil {
|
||||
@@ -138,12 +138,12 @@ func (g *gatewayClient) GetCardPayoutStatus(ctx context.Context, req *mntxv1.Get
|
||||
}
|
||||
|
||||
func (g *gatewayClient) ListGatewayInstances(ctx context.Context, req *mntxv1.ListGatewayInstancesRequest) (*mntxv1.ListGatewayInstancesResponse, error) {
|
||||
return nil, merrors.NotImplemented("mntx: ListGatewayInstances not supported via connector")
|
||||
return nil, merrors.NotImplemented("mcards: ListGatewayInstances not supported via connector")
|
||||
}
|
||||
|
||||
func operationFromCardPayout(req *mntxv1.CardPayoutRequest) (*connectorv1.Operation, error) {
|
||||
if req == nil {
|
||||
return nil, merrors.InvalidArgument("mntx: request is required")
|
||||
return nil, merrors.InvalidArgument("mcards: request is required")
|
||||
}
|
||||
params := payoutParamsFromCard(req)
|
||||
money := moneyFromMinor(req.GetAmountMinor(), req.GetCurrency())
|
||||
@@ -163,7 +163,7 @@ func operationFromCardPayout(req *mntxv1.CardPayoutRequest) (*connectorv1.Operat
|
||||
|
||||
func operationFromTokenPayout(req *mntxv1.CardTokenPayoutRequest) (*connectorv1.Operation, error) {
|
||||
if req == nil {
|
||||
return nil, merrors.InvalidArgument("mntx: request is required")
|
||||
return nil, merrors.InvalidArgument("mcards: request is required")
|
||||
}
|
||||
params := payoutParamsFromToken(req)
|
||||
money := moneyFromMinor(req.GetAmountMinor(), req.GetCurrency())
|
||||
|
||||
@@ -21,7 +21,7 @@ func initMetrics() {
|
||||
metricsOnce.Do(func() {
|
||||
rpcLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Namespace: "sendico",
|
||||
Subsystem: "mntx_gateway",
|
||||
Subsystem: "mcards_gateway",
|
||||
Name: "rpc_latency_seconds",
|
||||
Help: "Latency distribution for Monetix gateway RPC handlers.",
|
||||
Buckets: prometheus.DefBuckets,
|
||||
@@ -29,7 +29,7 @@ func initMetrics() {
|
||||
|
||||
rpcStatus = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "sendico",
|
||||
Subsystem: "mntx_gateway",
|
||||
Subsystem: "mcards_gateway",
|
||||
Name: "rpc_requests_total",
|
||||
Help: "Total number of RPC invocations grouped by method and status.",
|
||||
}, []string{"method", "status"})
|
||||
|
||||
@@ -21,21 +21,21 @@ func initMetrics() {
|
||||
metricsOnce.Do(func() {
|
||||
cardPayoutRequests = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "sendico",
|
||||
Subsystem: "mntx_gateway",
|
||||
Subsystem: "mcards_gateway",
|
||||
Name: "card_payout_requests_total",
|
||||
Help: "Monetix card payout submissions grouped by outcome.",
|
||||
}, []string{"outcome"})
|
||||
|
||||
cardPayoutCallbacks = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "sendico",
|
||||
Subsystem: "mntx_gateway",
|
||||
Subsystem: "mcards_gateway",
|
||||
Name: "card_payout_callbacks_total",
|
||||
Help: "Monetix card payout callbacks grouped by provider status.",
|
||||
}, []string{"status"})
|
||||
|
||||
cardPayoutLatency = promauto.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Namespace: "sendico",
|
||||
Subsystem: "mntx_gateway",
|
||||
Subsystem: "mcards_gateway",
|
||||
Name: "card_payout_request_latency_seconds",
|
||||
Help: "Latency distribution for outbound Monetix card payout requests.",
|
||||
Buckets: prometheus.DefBuckets,
|
||||
|
||||
Reference in New Issue
Block a user