Skip to content

feat: support business counterparties in bvnk - #879

Draft
multipletwigs wants to merge 3 commits into
mainfrom
feat/bvnk-business
Draft

feat: support business counterparties in bvnk#879
multipletwigs wants to merge 3 commits into
mainfrom
feat/bvnk-business

Conversation

@multipletwigs

Copy link
Copy Markdown
Collaborator

No description provided.

@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sdp-docs Ready Ready Preview, Comment Jul 27, 2026 3:19am
sdp-web Ready Ready Preview, Comment Jul 27, 2026 3:19am

Request Review

@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds BVNK business-counterparty onboarding support.

  • Collects and validates company and associate details and builds BVNK v2 company payloads.
  • Adds BVNK v2 agreement, company-customer, and customer-status API operations.
  • Extends provider support metadata and onboarding-status handling for business customers.

Confidence Score: 3/5

The partial-failure recovery gap in BVNK company creation should be fixed before merging because it can strand an already-created business customer.

Company creation occurs before local persistence, and unlike agreement creation, replaying the deterministic customer reference has no path to recover the existing remote customer after persistence fails.

apps/sdp-api/src/routes/payments/handlers/ramps/bvnk.ts; packages/sdp-payments/src/ramps/providers/bvnk/client.ts

Important Files Changed

Filename Overview
apps/sdp-api/src/routes/payments/handlers/ramps/bvnk.ts Adds the BVNK v2 company provisioning sequence, but does not recover customer creation after a remote-success/local-persistence partial failure.
packages/sdp-payments/src/ramps/providers/bvnk/client.ts Adds v2 agreements and customer endpoints; agreement creation handles duplicate conflicts while company customer creation does not.
packages/sdp-payments/src/ramps/providers/bvnk/counterparty.ts Adds business onboarding requirements, validation, and company payload construction with focused tests.
packages/sdp-payments/src/ramps/providers/bvnk/provider-data.ts Extends v2 onboarding statuses and tolerates the asynchronous absence of an authenticated verification link.
packages/sdp-types/src/generated/ramp-support.generated.ts Regenerates BVNK support metadata to advertise business on-ramp support.

Sequence Diagram

sequenceDiagram
  participant API as SDP API
  participant BVNK as BVNK v2
  participant DB as Provider Data
  API->>BVNK: Create or retrieve agreements
  API->>BVNK: Accept agreements
  API->>BVNK: Create company customer
  BVNK-->>API: Customer ID and status
  API->>DB: Persist customer resolution
  alt Persistence fails
    API->>BVNK: Retry creation with same reference
    BVNK-->>API: Conflict
  end
Loading

Reviews (1): Last reviewed commit: "feat: support business counterparties in..." | Re-trigger Greptile

Comment on lines +423 to +427
const created = await client.createBvnkCompanyCustomer(ctx, {
reference: expectedExternalReference,
useCase: BVNK_V2_USE_CASE,
company,
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Customer retry cannot recover

When BVNK creates the company customer but the subsequent provider-data upsert fails, the next request repeats customer creation with the same deterministic reference instead of retrieving the existing customer, causing the provider conflict to strand onboarding.

Knowledge Base Used: Payments: one-off transfers, recurring payments, private transfers, and fee payment

@multipletwigs
multipletwigs marked this pull request as draft July 23, 2026 11:47
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.

1 participant