Files
sendico/api/gateway/mntx
tech 94406373e6
All checks were successful
ci/woodpecker/push/billing_documents Pipeline was successful
ci/woodpecker/push/bff Pipeline was successful
ci/woodpecker/push/billing_fees Pipeline was successful
ci/woodpecker/push/callbacks Pipeline was successful
ci/woodpecker/push/discovery Pipeline was successful
ci/woodpecker/push/fx_ingestor Pipeline was successful
ci/woodpecker/push/frontend Pipeline was successful
ci/woodpecker/push/fx_oracle Pipeline was successful
ci/woodpecker/push/gateway_chain Pipeline was successful
ci/woodpecker/push/gateway_mntx Pipeline was successful
ci/woodpecker/push/gateway_tgsettle Pipeline was successful
ci/woodpecker/push/gateway_tron Pipeline was successful
ci/woodpecker/push/ledger Pipeline was successful
ci/woodpecker/push/notification Pipeline was successful
ci/woodpecker/push/payments_methods Pipeline was successful
ci/woodpecker/push/payments_orchestrator Pipeline was successful
ci/woodpecker/push/payments_quotation Pipeline was successful
Merge pull request 'fixed quotation currency inference' (#630) from pq-626 into main
Reviewed-on: #630
2026-03-04 04:13:55 +00:00
..
2026-03-04 02:46:51 +01:00
2026-03-04 05:04:34 +01:00
2026-02-27 03:57:52 +01:00
2026-02-28 21:01:39 +01:00
2026-02-28 21:01:39 +01:00
2026-03-04 02:46:51 +01:00

Monetix Gateway Card Payouts

This service now supports Monetix “payout by card”.

Runtime entry points

  • gRPC: MntxGatewayService.CreateCardPayout, CreateCardTokenPayout, GetCardPayoutStatus, ListGatewayInstances.
  • Callback HTTP server (default): :8084/monetix/callback for Monetix payout status notifications.
  • Metrics: Prometheus on :9404/metrics.

Required config/env

api/gateway/mntx/config.yml shows defaults. Key values (usually injected via env):

  • MONETIX_BASE_URL e.g. https://gate.monetix.com
  • MONETIX_PROJECT_ID integer project ID
  • MONETIX_SECRET_KEY signature secret
  • Optional: allowed_currencies, require_customer_address, request_timeout_seconds
  • Gateway descriptor: gateway.id, optional gateway.currencies, gateway.limits (for per-payout minimum use gateway.limits.per_tx_min_amount)
  • Callback server: MNTX_GATEWAY_HTTP_PORT (exposed as 8084), http.callback.path, optional allowed_cidrs

Outbound request (CreateCardPayout)

Payload is built per Monetix spec:

{
  "general":  { "project_id": <int>, "payment_id": "<operation_ref>", "signature": "<hmac>" },
  "customer": { id, first_name, last_name, middle_name?, ip_address, zip?, country?, state?, city?, address? },
  "payment":  { amount: <minor_units>, currency: "<ISO-4217>" },
  "card":     { pan, year?, month?, card_holder }
}

Gateway request contract additionally requires parent_payment_ref as a first-class field (separate from Monetix payment_id).

Signature: HMAC-SHA256 over the JSON body (without signature), using MONETIX_SECRET_KEY.

Callback handling

  • Endpoint only accepts POST with Monetix JSON body. Signature is verified with the same HMAC-SHA256 algorithm; invalid signatures return 403.
  • Maps Monetix statuses:
    • payment.status=success AND operation.status=success AND operation.code empty/0PAYOUT_STATUS_PROCESSED
    • processingPAYOUT_STATUS_PENDING
    • otherwise → PAYOUT_STATUS_FAILED
  • Emits CardPayoutStatusChangedEvent over messaging (event type: mntx_gateway, action: updated).

Metrics

  • sendico_mntx_gateway_card_payout_requests_total{outcome}
  • sendico_mntx_gateway_card_payout_request_latency_seconds{outcome}
  • sendico_mntx_gateway_card_payout_callbacks_total{status}
  • sendico_mntx_gateway_rpc_requests_total{method,status}
  • sendico_mntx_gateway_rpc_latency_seconds{method}

Notes / PCI

  • PAN is only logged in masked form; do not persist raw PAN.
  • Callback allows CIDR allow-listing; leave empty to accept all while testing.