chore(payments): Add the new released connectors#129
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 46 minutes and 21 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
WalkthroughAdds CLI commands and controllers to install and update configurations for six payment connectors (Fireblocks, Coinbase Prime, Increase, Powens, Tink, Plaid). Implements stores, controllers, command wiring, config file parsing, API calls (V3InstallConnector / V3UpdateConnectorConfig), rendering helpers, and registry entries. Changes
Sequence DiagramsequenceDiagram
actor User
participant CLI
participant Controller
participant Auth
participant StackClient
participant PaymentsAPI
participant Store
participant Renderer
User->>CLI: run install/update command with file + flags
CLI->>Controller: Run(args, flags)
Controller->>Auth: Load profile & authenticate
Auth-->>Controller: profile
Controller->>StackClient: Init client with profile
StackClient-->>Controller: client ready
Controller->>Controller: validate connector-id / version / args
Controller->>User: request approval
User->>Controller: approve / deny
alt approved
Controller->>Controller: read & parse JSON config file
Controller->>PaymentsAPI: InstallConnector / UpdateConnectorConfig (config)
PaymentsAPI-->>Controller: response (200-299 / error)
alt success
Controller->>Store: set Success=true, record ConnectorID/name
Store-->>Controller: persisted
Controller->>Renderer: Render success message
Renderer-->>User: display confirmation
else failure
Controller-->>User: return API error
end
else denied
Controller-->>User: return ErrMissingApproval
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cmd/payments/connectors/install/coinbaseprime.go`:
- Around line 75-77: The version check in coinbaseprime.go uses
c.PaymentsVersion < versions.V3 but the error text says ">= v3.2.0", causing a
mismatch; update the check or the message to be consistent: either change the
error string in the conditional that references c.PaymentsVersion and
versions.V3 to state ">= v3.0.0" to match versions.V3, or if the connector truly
requires v3.2.0 introduce/use a new finer-grained version constant (e.g.,
versions.V3_2 or similar) and replace versions.V3 with that constant in the same
conditional so the runtime check matches the "v3.2.0" message. Ensure you modify
the conditional and its fmt.Errorf text consistently.
In `@cmd/payments/connectors/install/tink.go`:
- Around line 75-77: The version check uses c.PaymentsVersion < versions.V3 but
the error text says ">= v3.1.0", causing a mismatch; update the check or message
to be consistent: either change the error string in the tink connector (and
similarly in plaid, powens, increase) to reflect the actual minimum
(v3.0.0-rc.1) referenced by versions.V3, or add and use a new constant (e.g.,
versions.V3_1) and compare c.PaymentsVersion < versions.V3_1 to enforce v3.1.0;
adjust the fmt.Errorf text to match whichever minimum you enforce.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c6d0125d-aa0c-4d00-9f53-a8eef1aeeba1
⛔ Files ignored due to path filters (2)
go.modis excluded by!**/*.modgo.sumis excluded by!**/*.sum,!**/*.sum
📒 Files selected for processing (15)
cmd/payments/connectors/configs/coinbaseprime.gocmd/payments/connectors/configs/fireblocks.gocmd/payments/connectors/configs/increase.gocmd/payments/connectors/configs/plaid.gocmd/payments/connectors/configs/powens.gocmd/payments/connectors/configs/root.gocmd/payments/connectors/configs/tink.gocmd/payments/connectors/install/coinbaseprime.gocmd/payments/connectors/install/fireblocks.gocmd/payments/connectors/install/increase.gocmd/payments/connectors/install/plaid.gocmd/payments/connectors/install/powens.gocmd/payments/connectors/install/root.gocmd/payments/connectors/install/tink.gocmd/payments/connectors/internal/connectors.go
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cmd/payments/connectors/configs/getconfig.go (1)
228-239: Consider a renderer registry before this switch grows again.These six cases keep
renderV3in lockstep with every provider-specific helper. Amap[string]func(*cobra.Command, *shared.V3GetConnectorConfigResponse) errorwould make future connector additions declarative and reduce missed wiring.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cmd/payments/connectors/configs/getconfig.go` around lines 228 - 239, Replace the growing switch in getconfig.go that calls provider-specific helpers (e.g., views.DisplayFireblocksConfigV3, views.DisplayCoinbaseprimeConfigV3, views.DisplayIncreaseConfigV3, views.DisplayPowensConfigV3, views.DisplayTinkConfigV3, views.DisplayPlaidConfigV3) with a registry map[string]func(*cobra.Command, *shared.V3GetConnectorConfigResponse) error keyed by the connector constants (internal.FireblocksConnector, internal.CoinbaseprimeConnector, etc.); look up the handler from the map using the connector key and call it with (cmd, c.store.V3ConnectorConfig), falling back to the existing default path if the key is missing—this makes renderV3 wiring declarative and avoids adding switch cases for each new connector.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@cmd/payments/connectors/views/fireblocks.go`:
- Around line 20-23: The output currently prints secrets verbatim (see tableData
appends for APIKey and PrivateKey in the Fireblocks config renderer); change the
renderer to omit or redact secret values before adding them to tableData (e.g.,
replace config.APIKey and config.PrivateKey with a redacted placeholder or
masked string) and keep non-secret fields (Endpoint, PollingPeriod via
fctl.StringPointerToString) unchanged so logs no longer leak live credentials.
---
Nitpick comments:
In `@cmd/payments/connectors/configs/getconfig.go`:
- Around line 228-239: Replace the growing switch in getconfig.go that calls
provider-specific helpers (e.g., views.DisplayFireblocksConfigV3,
views.DisplayCoinbaseprimeConfigV3, views.DisplayIncreaseConfigV3,
views.DisplayPowensConfigV3, views.DisplayTinkConfigV3,
views.DisplayPlaidConfigV3) with a registry map[string]func(*cobra.Command,
*shared.V3GetConnectorConfigResponse) error keyed by the connector constants
(internal.FireblocksConnector, internal.CoinbaseprimeConnector, etc.); look up
the handler from the map using the connector key and call it with (cmd,
c.store.V3ConnectorConfig), falling back to the existing default path if the key
is missing—this makes renderV3 wiring declarative and avoids adding switch cases
for each new connector.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 40f47622-3e89-440a-a922-7052cb3ea236
📒 Files selected for processing (8)
cmd/payments/connectors/configs/getconfig.gocmd/payments/connectors/views/atlar.gocmd/payments/connectors/views/coinbaseprime.gocmd/payments/connectors/views/fireblocks.gocmd/payments/connectors/views/increase.gocmd/payments/connectors/views/plaid.gocmd/payments/connectors/views/powens.gocmd/payments/connectors/views/tink.go
💤 Files with no reviewable changes (1)
- cmd/payments/connectors/views/atlar.go
laouji
left a comment
There was a problem hiding this comment.
The dirty check is failing but otherwise looks good.
Resolves EN-147