diff --git a/app/services/clients/ledger.client.js b/app/services/clients/ledger.client.js index 6de87e2912..5607cebe36 100644 --- a/app/services/clients/ledger.client.js +++ b/app/services/clients/ledger.client.js @@ -34,7 +34,8 @@ const transaction = async function transaction (id, gatewayAccountId, options = } const transactionWithAccountOverride = async function transactionWithAccountOverride (id, options = {}) { - const url = urlJoin(defaultOptions.baseUrl,'/v1/transaction', id) + const baseUrl = options.baseUrl ? options.baseUrl : defaultOptions.baseUrl + const url = urlJoin(baseUrl,'/v1/transaction', id) this.client = new Client(defaultOptions.service) const fullUrl = `${url}?override_account_id_restriction=true` configureClient(this.client, fullUrl) diff --git a/app/services/clients/ledger.client.test.js b/app/services/clients/ledger.client.test.js index 013d558afd..5d4d4a2d56 100644 --- a/app/services/clients/ledger.client.test.js +++ b/app/services/clients/ledger.client.test.js @@ -121,8 +121,7 @@ describe('Ledger client', () => { await ledgerClient.transactionWithAccountOverride('id', { baseUrl: 'https://example.com' }) - expect(configureSpy.getCall(0).args[0]).to.equal('http://127.0.0.1:8006/v1/transaction/id?override_account_id_restriction=true') - // expect(configureSpy.getCall(0).args[0]).to.equal('https://example.com/v1/transaction/id?override_account_id_restriction=true') + expect(configureSpy.getCall(0).args[0]).to.equal('https://example.com/v1/transaction/id?override_account_id_restriction=true') }) })