From ebc53794518a6968bacebb7e7412cb1b5b4efa45 Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Wed, 3 Jun 2026 11:16:03 -0600 Subject: [PATCH 1/3] BILL-5586: Add descriptor_code support to bank account verification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stripe updated microdeposit verification from two amounts to a single 6-character descriptor code. The Node SDK is a pass-through wrapper so no model changes are needed — this adds fixture and test coverage for the new path and exposes microdeposit_type in the BANK_ACCOUNT fixture. Co-Authored-By: Claude Sonnet 4.6 --- test/bankAccounts.js | 59 ++++++++++++++++++++++++++++++++++++++++-- test/mocks/fixtures.js | 1 + 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/test/bankAccounts.js b/test/bankAccounts.js index e7c02be..f3d2cba 100644 --- a/test/bankAccounts.js +++ b/test/bankAccounts.js @@ -117,10 +117,10 @@ describe('bank accounts', () => { describe('verify', () => { - it('verifies a bank account', (done) => { + it('verifies a bank account with amounts', (done) => { const bankAccountId = fixtures.BANK_ACCOUNT.id; const amounts = [23, 34]; - const verifiedBankAccount = fixtures.clone(fixtures.BANK_ACCOUNT, { verified: true }); + const verifiedBankAccount = fixtures.clone(fixtures.BANK_ACCOUNT, { verified: true, microdeposit_type: null }); mockLob() .post('/v1/bank_accounts') @@ -142,6 +142,61 @@ describe('bank accounts', () => { }); }); + it('verifies a bank account with descriptor_code', (done) => { + const bankAccountId = fixtures.BANK_ACCOUNT.id; + const verifiedBankAccount = fixtures.clone(fixtures.BANK_ACCOUNT, { verified: true, microdeposit_type: null }); + + mockLob() + .post('/v1/bank_accounts') + .reply(200, fixtures.clone(fixtures.BANK_ACCOUNT, { microdeposit_type: 'descriptor_code' })); + + mockLob() + .post(`/v1/bank_accounts/${ bankAccountId }/verify`) + .reply(200, verifiedBankAccount); + + Lob.bankAccounts.create(BANK_ACCOUNT_INPUT, (_err, res) => { + Lob.bankAccounts.verify(res.id, { descriptor_code: 'SM11AA' }, (_err2, res2) => { + expect(res2).to.have.property('id'); + expect(res2.verified).to.eql(true); + expect(res2.object).to.eql('bank_account'); + return done(); + }); + }); + }); + + }); + + describe('microdeposit_type', () => { + + it('exposes microdeposit_type on a retrieved bank account', (done) => { + const bankAccountId = fixtures.BANK_ACCOUNT.id; + + mockLob() + .get(`/v1/bank_accounts/${ bankAccountId}`) + .reply(200, fixtures.BANK_ACCOUNT); + + Lob.bankAccounts.retrieve(bankAccountId, (err, res) => { + expect(res).to.have.property('microdeposit_type'); + expect(['amounts', 'descriptor_code']).to.include(res.microdeposit_type); + return done(); + }); + }); + + it('microdeposit_type is null once verified', (done) => { + const bankAccountId = fixtures.BANK_ACCOUNT.id; + const verifiedAccount = fixtures.clone(fixtures.BANK_ACCOUNT, { verified: true, microdeposit_type: null }); + + mockLob() + .get(`/v1/bank_accounts/${ bankAccountId}`) + .reply(200, verifiedAccount); + + Lob.bankAccounts.retrieve(bankAccountId, (err, res) => { + expect(res.verified).to.eql(true); + expect(res.microdeposit_type).to.eql(null); + return done(); + }); + }); + }); }); diff --git a/test/mocks/fixtures.js b/test/mocks/fixtures.js index 422573a..e296128 100644 --- a/test/mocks/fixtures.js +++ b/test/mocks/fixtures.js @@ -26,6 +26,7 @@ const BANK_ACCOUNT = { account_type: 'company', signatory: 'John Doe', verified: false, + microdeposit_type: 'amounts', date_created: '2024-01-16T12:00:00.000Z', date_modified: '2024-01-16T12:00:00.000Z' }; From ad41b018c1ec227257863ecf8cb68dbd3b9d2bfe Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Wed, 3 Jun 2026 11:24:57 -0600 Subject: [PATCH 2/3] Address PR comment: propagate callback errors to done() in new tests --- test/bankAccounts.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/bankAccounts.js b/test/bankAccounts.js index f3d2cba..a2fcb72 100644 --- a/test/bankAccounts.js +++ b/test/bankAccounts.js @@ -154,8 +154,10 @@ describe('bank accounts', () => { .post(`/v1/bank_accounts/${ bankAccountId }/verify`) .reply(200, verifiedBankAccount); - Lob.bankAccounts.create(BANK_ACCOUNT_INPUT, (_err, res) => { - Lob.bankAccounts.verify(res.id, { descriptor_code: 'SM11AA' }, (_err2, res2) => { + Lob.bankAccounts.create(BANK_ACCOUNT_INPUT, (err, res) => { + if (err) return done(err); + Lob.bankAccounts.verify(res.id, { descriptor_code: 'SM11AA' }, (err2, res2) => { + if (err2) return done(err2); expect(res2).to.have.property('id'); expect(res2.verified).to.eql(true); expect(res2.object).to.eql('bank_account'); @@ -176,6 +178,7 @@ describe('bank accounts', () => { .reply(200, fixtures.BANK_ACCOUNT); Lob.bankAccounts.retrieve(bankAccountId, (err, res) => { + if (err) return done(err); expect(res).to.have.property('microdeposit_type'); expect(['amounts', 'descriptor_code']).to.include(res.microdeposit_type); return done(); @@ -191,6 +194,7 @@ describe('bank accounts', () => { .reply(200, verifiedAccount); Lob.bankAccounts.retrieve(bankAccountId, (err, res) => { + if (err) return done(err); expect(res.verified).to.eql(true); expect(res.microdeposit_type).to.eql(null); return done(); From b2a18eacb9aee95e593a6ac90980653d199221f8 Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Wed, 3 Jun 2026 17:08:48 -0600 Subject: [PATCH 3/3] chore: bump version to 8.1.0 Co-Authored-By: Claude Sonnet 4.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b424b1..ae6eddf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lob", - "version": "7.1.0", + "version": "8.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lob", - "version": "7.1.0", + "version": "8.1.0", "license": "MIT", "dependencies": { "axios": "^1.16.1", diff --git a/package.json b/package.json index 1816bf5..c35c5c5 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "Lob.com", "printing" ], - "version": "8.0.0", + "version": "8.1.0", "homepage": "https://github.com/lob/lob-node", "author": "Lob (https://lob.com/)", "dependencies": {