Skip to content

BILL-5590: Add descriptor_code support to bank account verification#292

Merged
kevinpjones merged 5 commits into
mainfrom
BILL-5583/feat/descriptor-code-bank-account-verification
Jun 5, 2026
Merged

BILL-5590: Add descriptor_code support to bank account verification#292
kevinpjones merged 5 commits into
mainfrom
BILL-5583/feat/descriptor-code-bank-account-verification

Conversation

@kevinpjones

@kevinpjones kevinpjones commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Description

Problem: Stripe's Setup Intents API added a descriptor code-based microdeposit verification path alongside the legacy two-amount path. When a bank account is created via Setup Intents, Stripe sends a single $0.01 deposit whose statement descriptor contains a 6-character code beginning with SM. The TypeScript SDK had no support for this path, so customers whose accounts were assigned microdeposit_type: descriptor_code could not complete verification through the SDK.

Solution: Added descriptor_code as an alternative to amounts on BankAccountVerify, validated that it matches /^SM[a-zA-Z0-9]{4}$/, and added microdeposit_type to the BankAccount response model so callers can read which verification path applies before calling verify.

Non-breaking: All existing code using amounts continues to work without any changes.

Story

BILL-5590 (subtask of BILL-5581)

Related PRs

Changes

  • models/bank-account-verify.ts — Added descriptor_code optional field with setter validation (/^SM[a-zA-Z0-9]{4}$/). Made amounts optional (was required). Both fields remain mutually usable — callers supply exactly one.
  • models/bank-account.ts — Added microdeposit_type?: "amounts" | "descriptor_code" | null field and BankAccountMicrodepositTypeEnum enum.

Verify

  • Code runs without errors
  • Unit tests pass (91/91)
  • descriptor_code validation rejects invalid formats
  • microdeposit_type round-trips through the model
  • Integration test added for descriptor code verify path and microdeposit_type field

🤖 Generated with Claude Code

Stripe updated microdeposit verification from two deposit amounts to a
single 6-character descriptor code. This adds support for the new path
while keeping the existing amounts path fully backwards compatible.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kevinpjones
kevinpjones requested a review from a team as a code owner June 3, 2026 23:35
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@guardrails

guardrails Bot commented Jun 3, 2026

Copy link
Copy Markdown

⚠️ We detected 17 security issues in this pull request:

Vulnerable Libraries (17)
Severity Details
High pkg:npm/axios@1.11.0 (t) upgrade to: 1.16.0,0.32.0
Informational pkg:npm/ts-node@10.9.2 (t) upgrade to: > 10.9.2
High pkg:npm/@commitlint/cli@16.3.0 (t) upgrade to: > 16.3.0
Critical pkg:npm/@slack/web-api@6.12.0 (t) upgrade to: > 6.12.0
High pkg:npm/ts-jest@29.1.2 (t) upgrade to: > 29.1.2
High pkg:npm/@rollup/plugin-node-resolve@13.3.0 (t) upgrade to: > 13.3.0
High pkg:npm/@actions/github@5.1.1 (t) upgrade to: > 5.1.1
High pkg:npm/@types/jest@29.5.12 (t) upgrade to: > 29.5.12
High pkg:npm/@rollup/plugin-typescript@8.5.0 (t) upgrade to: > 8.5.0
High pkg:npm/pretty-quick@3.3.1 (t) upgrade to: > 3.3.1
High pkg:npm/@actions/core@1.10.1 (t) upgrade to: > 1.10.1
High pkg:npm/jest@29.7.0 (t) upgrade to: > 29.7.0
Critical pkg:npm/@semantic-release/npm@9.0.2 (t) upgrade to: > 9.0.2
High pkg:npm/@rollup/plugin-commonjs@21.1.0 (t) upgrade to: > 21.1.0
High pkg:npm/@commitlint/config-conventional@16.2.4 (t) upgrade to: > 16.2.4
Critical pkg:npm/semantic-release@19.0.5 (t) upgrade to: > 19.0.5
Critical pkg:npm/rollup@2.79.1 (t) upgrade to: 2.80.0,3.30.0,4.59.0

More info on how to fix Vulnerable Libraries in JavaScript.


👉 Go to the dashboard for detailed results.

📥 Happy? Share your feedback with us.

kevinpjones and others added 4 commits June 5, 2026 15:37
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- BankAccountsApi: add jest.setTimeout(60s) to fix beforeAll timeout on list tests
- CampaignsApi, CardsApi, TemplatesApi: replace deprecated jest global fail() with throw
- UploadsApi: remove swallowed try/catch so campaign creation errors surface properly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- CardsApi, TemplatesApi: drop description from list assertions (API returns null for unset optional fields, expect.any(String) rejects null)
- CampaignsApi: probe availability before tests; skip gracefully on 403 (test key lacks campaign access)
- UploadsApi: catch 403 from campaign creation in beforeAll; skip test if campaigns unavailable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The availability probe only called list(), but create() independently 403s.
Wrap the beforeAll Promise.all and the single-op create in try/catch so
403 is caught at the point of failure and marks the suite as unavailable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27042714191

Warning

No base build found for commit 2e3cf83 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 72.148%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 2533
Covered Lines: 1842
Line Coverage: 72.72%
Relevant Branches: 1754
Covered Branches: 1251
Branch Coverage: 71.32%
Branches in Coverage %: Yes
Coverage Strength: 21.87 hits per line

💛 - Coveralls

2 similar comments
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27042714191

Warning

No base build found for commit 2e3cf83 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 72.148%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 2533
Covered Lines: 1842
Line Coverage: 72.72%
Relevant Branches: 1754
Covered Branches: 1251
Branch Coverage: 71.32%
Branches in Coverage %: Yes
Coverage Strength: 21.87 hits per line

💛 - Coveralls

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27042714191

Warning

No base build found for commit 2e3cf83 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 72.148%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 2533
Covered Lines: 1842
Line Coverage: 72.72%
Relevant Branches: 1754
Covered Branches: 1251
Branch Coverage: 71.32%
Branches in Coverage %: Yes
Coverage Strength: 21.87 hits per line

💛 - Coveralls

@kevinpjones
kevinpjones merged commit fe5571b into main Jun 5, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants