Files
b55b031c61 feat(api): EN-1023 expose connector capabilities on v3 (#727)
* feat(api): EN-1023 expose connector capabilities on v3

Add `GET /v3/connectors/capabilities` (full catalog, ETag-cached for the
stateless console) and `GET /v3/connectors/{connectorID}/capabilities`,
and inline a `capabilities` field on each row of `v3ListConnectors` so
platform-ui can gate per-connector submenus (Accounts/Payments/Transfers)
on what the underlying plugin actually supports.

Capability owns its JSON wire encoding (MarshalJSON/UnmarshalJSON) so
the format stays aligned with the DB Value/Scan representation.

Co-authored-by: Cursor <[email protected]>

* fix(api): EN-1023 address CodeRabbit review

- Replace `new(value)` with the local-variable `&v` pattern used elsewhere
  in v3 for `api.BaseResponse.Data`.
- Service: drop the registry error from the 404 translation, honouring
  the comment's non-leak intent.
- List handler: normalise the storage provider through `ToV3Provider`
  before looking up capabilities so legacy v2 rows (`"STRIPE"`, etc.) hit
  the registry's lowercase keys; test now exercises that path.
- Registry: clone capability slices in `GetAllCapabilities` so callers
  can't mutate plugin registrations through the returned map.
- E2E: wait for the uninstall workflow via the shared helper and assert a
  concrete capability instead of just non-nil.

Co-authored-by: Cursor <[email protected]>

---------

Co-authored-by: Cursor <[email protected]>
2026-06-11 13:12:20 +00:00

1.7 KiB

V3Capability

Plugin capability advertised by a connector. Distinct from the Formance gateway "module capabilities" (which are version-gated); these reflect what the underlying PSP integration actually exposes.

Values

Name Value
V3CapabilityFetchAccounts FETCH_ACCOUNTS
V3CapabilityFetchBalances FETCH_BALANCES
V3CapabilityFetchExternalAccounts FETCH_EXTERNAL_ACCOUNTS
V3CapabilityFetchPayments FETCH_PAYMENTS
V3CapabilityFetchOthers FETCH_OTHERS
V3CapabilityFetchOrders FETCH_ORDERS
V3CapabilityFetchConversions FETCH_CONVERSIONS
V3CapabilityCreateWebhooks CREATE_WEBHOOKS
V3CapabilityTranslateWebhooks TRANSLATE_WEBHOOKS
V3CapabilityCreateBankAccount CREATE_BANK_ACCOUNT
V3CapabilityCreateTransfer CREATE_TRANSFER
V3CapabilityCreatePayout CREATE_PAYOUT
V3CapabilityAllowFormanceAccountCreation ALLOW_FORMANCE_ACCOUNT_CREATION
V3CapabilityAllowFormancePaymentCreation ALLOW_FORMANCE_PAYMENT_CREATION