feat: support business counterparties in bvnk - #879
Conversation
Greptile SummaryAdds BVNK business-counterparty onboarding support.
Confidence Score: 3/5The 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
Sequence DiagramsequenceDiagram
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
Reviews (1): Last reviewed commit: "feat: support business counterparties in..." | Re-trigger Greptile |
| const created = await client.createBvnkCompanyCustomer(ctx, { | ||
| reference: expectedExternalReference, | ||
| useCase: BVNK_V2_USE_CASE, | ||
| company, | ||
| }); |
There was a problem hiding this comment.
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
No description provided.