Skip to content

BILL-5592: Add descriptor_code support to bank account verification#58

Open
kevinpjones wants to merge 7 commits into
mainfrom
bill-5581-descriptor-code-elixir
Open

BILL-5592: Add descriptor_code support to bank account verification#58
kevinpjones wants to merge 7 commits into
mainfrom
bill-5581-descriptor-code-elixir

Conversation

@kevinpjones

@kevinpjones kevinpjones commented Jun 4, 2026

Copy link
Copy Markdown

Description

Problem: Stripe updated bank account microdeposit verification from two deposit amounts to a single descriptor code (a 6-character alphanumeric string beginning with SM that appears on the customer's bank statement). The Elixir SDK had no support for the new path, so customers whose accounts are assigned microdeposit_type: descriptor_code could not complete verification through the SDK.

Solution: The Elixir SDK passes verify request data through generically, so descriptor_code works automatically. Added tests to confirm both verify paths work and that microdeposit_type is present in bank account responses. Also fixed pre-existing test failures caused by HTTP/2 normalizing header names to lowercase, updated deps for OTP 27 compatibility, and configured hackney to trust the system CA bundle for Cloudflare WARP environments.

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

Story

BILL-5592 / BILL-5581

Related PRs

Verify

  • mix test test/lob/bank_account_test.exs — all 11 bank account tests pass
  • mix test — 78/80 tests pass; 2 remaining failures are pre-existing unrelated issues (stale zip fixture in USZipLookupTest, non-deterministic map ordering in Util doctest)

🤖 Generated with Claude Code

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

- BankAccount.verify/3 already passes data through generically; descriptor_code
  works automatically with no structural changes needed
- microdeposit_type in GET /v1/bank_accounts/:id response is decoded
  automatically via Poison's atom-key parsing
- Added tests for descriptor_code verify path and microdeposit_type field
- Fixed pre-existing test failures: HTTP/2 lowercases header names
  (X-Rate-Limit-Limit → x-rate-limit-limit) across all test files
- Pinned Elixir to 1.18.4-otp-27 in mise.toml (stable, not bleeding-edge)
- Updated deps for OTP 27 compatibility; configured hackney to use the
  system CA bundle so Cloudflare WARP TLS inspection doesn't break tests
- Bumped version to 1.6.0

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for descriptor_code in bank account verification, exposes microdeposit_type in bank account responses, and configures Hackney to trust the system CA bundle to handle TLS inspection. It also updates tests to use lowercase HTTP header keys and adds new tests for the bank account features. The review feedback highlights that evaluating :public_key.cacerts_get() at compile time bakes the build environment's CA certificates into the compiled BEAM files, and suggests wrapping the configuration in a zero-arity function to allow dynamic runtime evaluation. Additionally, the feedback recommends using on_exit/1 in the new bank account tests to ensure created resources are properly cleaned up and not leaked, even if assertions fail.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/lob/client.ex Outdated
Comment thread config/dev.exs Outdated
Comment thread config/test.exs Outdated
Comment thread test/lob/bank_account_test.exs
Comment thread test/lob/bank_account_test.exs
kevinpjones and others added 3 commits June 4, 2026 11:02
OTP 22.0 is not available on ubuntu-24.04 (ubuntu-latest now resolves
to 24.04). Align CI with the versions pinned in mise.toml.
Also update actions/checkout from v2 to v4 to silence Node.js 20
deprecation warning.

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

coveralls commented Jun 4, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 0

Warning

No base build found for commit 56311e6 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: 89.583%

Details

  • Patch coverage: 1 uncovered change across 1 file (2 of 3 lines covered, 66.67%).

Uncovered Changes

File Changed Covered %
lib/lob/client.ex 3 2 66.67%

Coverage Regressions

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


Coverage Stats

Coverage Status
Relevant Lines: 48
Covered Lines: 43
Line Coverage: 89.58%
Coverage Strength: 73.69 hits per line

💛 - Coveralls

kevinpjones and others added 3 commits June 4, 2026 11:22
- USZipLookupTest: API returns a different zip than the one sent;
  drop the echo-assertion, keep meaningful type/cities checks
- Util build_body doctest: map iteration order is non-deterministic;
  assert on membership instead of a fixed-order list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
credo 1.5.6 crashes with CaseClauseError on Elixir 1.18's tokenizer output.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Also drop --halt-exit-status from dialyzer CI command (no longer valid
in dialyxir for OTP 27).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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