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())
|
||||
|
||||
Reference in New Issue
Block a user