Skip to content

fix(payments): EN-601 Use v3 with get config#104

Merged
Quentin-David-24 merged 6 commits intomainfrom
fix/EN-601-get-config-v3
Jan 27, 2026
Merged

fix(payments): EN-601 Use v3 with get config#104
Quentin-David-24 merged 6 commits intomainfrom
fix/EN-601-get-config-v3

Conversation

@Quentin-David-24
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 2, 2026

Walkthrough

Adds V3 connector config support: the command fetches and stores V3 responses, routes rendering to version-specific renderers, and adds provider-specific DisplayXxxConfigV3 functions to render V3 configs as tables alongside legacy V1/V2 handling.

Changes

Cohort / File(s) Summary
Command handler
cmd/payments/connectors/configs/getconfig.go
Added V3ConnectorConfig storage field; Run() now fetches V3 via V3 API when version is V3; Render() dispatches to renderV3 or renderV1V2; added renderV3 and renderV1V2; updated command aliases and provider flag text.
New V3 display functions (consistent pattern)
cmd/payments/connectors/views/adyen.go, .../atlar.go, .../banking_circle.go, .../currency_cloud.go, .../mangopay.go, .../modulr.go, .../moneycorp.go, .../stripe.go, .../wise.go
Added DisplayXxxConfigV3(cmd, *shared.V3GetConnectorConfigResponse) for each connector, using fctl.StringPointerToString for pointer fields and rendering pterm tables from v3Config.Data.
Replacements / behavior changes for some connectors
cmd/payments/connectors/views/column.go, cmd/payments/connectors/views/qonto.go
Replaced prior v1-style display with V3-specific display (DisplayColumnConfigV3, DisplayQontoConfigV3), removed JSON serialization, switched data source to V3GetConnectorConfigResponse, updated imports.
Minor view updates
various view files (small spacing/alignment edits)
Minor formatting/alignment and immediate table render calls with error returns in several view functions.

Sequence Diagram

sequenceDiagram
    participant CLI as CLI Client
    participant Cmd as getconfig Command
    participant API as Payments API
    participant Store as Local Store
    participant Renderer as Renderer

    CLI->>Cmd: invoke getconfig (connector-id, version)
    Cmd->>Cmd: validate args
    alt version == V3
        Cmd->>API: V3.GetConnectorConfig(connector-id)
        API-->>Cmd: V3GetConnectorConfigResponse
        Cmd->>Cmd: validate response status & derive provider
        Cmd->>Store: store V3ConnectorConfig
        Cmd->>Renderer: renderV3(provider, v3Config)
        Renderer->>Renderer: call DisplayXxxConfigV3(v3Config)
        Renderer-->>CLI: render table output
    else
        Cmd->>API: GetConnectorConfig(connector-id)
        API-->>Cmd: ConnectorConfigResponse
        Cmd->>Cmd: derive provider
        Cmd->>Store: store ConnectorConfig
        Cmd->>Renderer: renderV1V2(provider, config)
        Renderer->>Renderer: call DisplayXxxConfig(config)
        Renderer-->>CLI: render table output
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through code with joyous cheer,
V3 configs now appear,
Tables bloom for each connector bright,
Old and new shown side by side tonight,
A little hop — the output’s clear! 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether one exists and relates to the changeset. Add a pull request description explaining the purpose of V3 support migration for the get config functionality.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(payments): EN-601 Use v3 with get config' accurately reflects the main changeset, which introduces V3 support throughout the payments connectors configuration system.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/EN-601-get-config-v3

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • EN-601: Authentication required, not authenticated - You need to authenticate to access this operation.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

connectorID := fctl.GetString(cmd, c.connectorIDFlag)

switch c.PaymentsVersion {
case versions.V3:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original getConfig allows to specify only the provider, then to request the user to select the connector if there is multiple. I forced the use of connectorId for this case.

@@ -18,9 +18,10 @@ import (
)

type PaymentsGetConfigStore struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some connectors don't have the same config in v1 and in v3. I think it's easier on the code and on the maintenance to handle the two different versions.

@Quentin-David-24 Quentin-David-24 marked this pull request as ready for review January 27, 2026 13:26
@Quentin-David-24 Quentin-David-24 requested a review from a team as a code owner January 27, 2026 13:26
@Quentin-David-24
Copy link
Contributor Author

It seems there is some ongoing issue with the CI / pre-commit ( speakeasy last version being downloaded instead of using nix's and updating the lock files ) and that last PRs are being forced.

Local build works well.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmd/payments/connectors/views/banking_circle.go (1)

15-23: Add "Polling Period" to banking_circle v1/v2 display for consistency with other connectors.

The v1/v2 renderer lacks the "Polling Period" field that is present in DisplayBankingCircleConfigV3 and in both v1/v2 and v3 renderers of all other connectors (wise, stripe, qonto, moneycorp, modulr, mangopay, currency_cloud, column, atlar, adyen). This appears to be an oversight—either add it or explicitly document why banking_circle differs.

📎 Suggested addition
 tableData = append(tableData, []string{pterm.LightCyan("Authorization endpoint:"), config.AuthorizationEndpoint})
+tableData = append(tableData, []string{pterm.LightCyan("Polling Period:"), fctl.StringPointerToString(config.PollingPeriod)})
 tableData = append(tableData, []string{pterm.LightCyan("UserCertificate:"), config.UserCertificate})
🤖 Fix all issues with AI agents
In `@cmd/payments/connectors/configs/getconfig.go`:
- Around line 202-233: In PaymentsLoadConfigController.renderV3 change the
default branch so it sets and returns a non-nil error instead of only printing:
assign err (e.g. fmt.Errorf("unknown provider: %s", c.store.Provider)) in the
default case and return that error at the end; make the same change in the
analogous render function referenced by the reviewer (the other render path
around lines 239-263) so both render functions fail the command when the
provider is unknown. Ensure you import or use the appropriate errors/fmt package
to construct the error.
🧹 Nitpick comments (1)
cmd/payments/connectors/views/column.go (1)

19-19: Minor: Inconsistent label formatting.

The label "APIKey:" differs from other connectors which use "API key:" (with a space and lowercase 'k'). Consider aligning for consistency.

Suggested fix
-	tableData = append(tableData, []string{pterm.LightCyan("APIKey:"), config.APIKey})
+	tableData = append(tableData, []string{pterm.LightCyan("API key:"), config.APIKey})

@laouji
Copy link
Contributor

laouji commented Jan 27, 2026

@Quentin-David-24 internal/deployserverclient/.speakeasy/workflow.yaml has latest as the speakeasy version configured. You need to sync this with the one defined in flake.nix

@Quentin-David-24 Quentin-David-24 merged commit 8047fea into main Jan 27, 2026
4 checks passed
@Quentin-David-24 Quentin-David-24 deleted the fix/EN-601-get-config-v3 branch January 27, 2026 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants