Skip to content

Conversation

ntorionbearstudio
Copy link

Description

This PR implements a new checkout.com connector for the Payments service, enabling integration with the checkout.com payment platform.

The connector supports:

  • Fetching accounts, balances and payments
  • Creating transfers
  • Creating payouts

We are using the checkout go sdk for operations, except for fetching payments (/payments/search api endpoint is not available yet on checkout go sdk)

Implementation issues

Currently here are the implementation issues while implementing checkout.com connector :

Fetching accounts

We fetch only the entity details (so only one account really fetched) c.sdk.Accounts.GetEntity(c.entityID)
(entityID is from connector config)
There is no api endpoint on checkout.com to fetch all accounts

Required config for connector

Environment string sandbox | production
OAuthClientID string
OAuthClientSecret string
EntityID string example : ent_xxxxxx
ProcessingChannelId string example : pc_xxxxxx

Transfers and payouts

Can't test transfers and payouts locally (we can't start the formance console UI in local do simulate actions)
All transfers are currently declared as "commission" on checkout.com

For payouts, only bank payouts are currently managed : https://api-reference.checkout.com/#operation/requestAPaymentOrPayout

Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@Quentin-David-24 Quentin-David-24 left a comment

Choose a reason for hiding this comment

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

Hey, thanks for your contribution to Formance Connectivity module!

If you have any question or interrogation we'll be happy to help you.

Regarding the entityId issue, indeed it does not seem possible to fetch all accounts.

I think it is fine to have the entityId configured and to have multiple connectors if you have several accounts.

I’ll have a check on the testing issue for transfers

Would you need a first review from one of our dev (I’m not competent enough for a good review!)?

type: string
name:
type: string
oauthClientID:
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to specify "oauth", just name it "clientID" and "clientSecret" as we did for the other connectors

switch from.Status {
case "Pending":
return models.PAYMENT_STATUS_PENDING
case "Captured", "Authorized", "Active":
Copy link
Contributor

Choose a reason for hiding this comment

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

Not exactly sure on this one, but we have "PAYMENT_STATUS_CAPTURE" which might be more relevant for this one?

type Config struct {
// This is the config a user will pass when installing this connector.
// Authentication criteria for connecting to your connector should be provided here. Example:
Environment string `json:"environment" validate:"required"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest "isSandbox" with a boolean

Comment on lines +15 to +18
OAuthClientID string `json:"oauthClientID" validate:"required"`
OAuthClientSecret string `json:"oauthClientSecret" validate:"required"`
EntityID string `json:"entityId" validate:"required"`
ProcessingChannelId string `json:"processingChannelId" validate:"required"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Different case in go and json for Id:
ID in go, Id in json

Suggested change
OAuthClientID string `json:"oauthClientID" validate:"required"`
OAuthClientSecret string `json:"oauthClientSecret" validate:"required"`
EntityID string `json:"entityId" validate:"required"`
ProcessingChannelId string `json:"processingChannelId" validate:"required"`
OAuthClientID string `json:"oauthClientId" validate:"required"`
OAuthClientSecret string `json:"oauthClientSecret" validate:"required"`
EntityID string `json:"entityId" validate:"required"`
ProcessingChannelID string `json:"processingChannelId" validate:"required"`

WithScopes(getOAuthScopes()).
Build()
if err != nil {
panic(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

panic is reserved to prevent application startup. For regular business code like this we should propagate the error

    // In plugin.go
	cl, err := client.New(
		cfg.Environment,
		cfg.OAuthClientID,
		cfg.OAuthClientSecret,
		cfg.EntityID,
		cfg.ProcessingChannelId,
	)
	if err != nil {
		return nil, err
	}

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