Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ To initialize the wrapper, import `lob` and set the `api_key`
```python
import lob
lob.api_key = 'your-api-key'

// set an api version (optional)
lob.api_version = 'api-version'
```

## API Reference
Expand Down
2 changes: 1 addition & 1 deletion examples/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Creating a Bank Account using the previously created account_address

example_bank_account = lob.BankAccount.create(
routing_number = '123456789',
routing_number = '122100024',
account_number = '1234564789',
bank_address = {
'name': 'Bank Address',
Expand Down
3 changes: 3 additions & 0 deletions lob/api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def request(self, method, url, params=None):
'User-Agent': 'Lob/v1 PythonBindings/%s' % VERSION
}

if hasattr(lob, 'api_version'):
headers['Lob-Version'] = lob.api_version

if method == 'get':
return self.parse_response(
requests.get(lob.api_base + url, auth=(self.api_key, ''), params=params, headers=headers)
Expand Down
2 changes: 1 addition & 1 deletion lob/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '2.9'
VERSION = '2.10'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup (
name = 'lob',
version = '2.9',
version = '2.10',
author = 'Lob',
author_email = 'support@lob.com',
packages = ['lob'],
Expand Down
4 changes: 4 additions & 0 deletions tests/test_lob.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
class TestLob(unittest.TestCase):
def setUp(self):
lob.api_key = 'asdf'
lob.api_version = 'apiVersion'

def test_bad_auth(self):
self.assertRaises(lob.error.AuthenticationError, lob.Address.list)

def test_set_version(self):
self.assertEqual(lob.api_version, 'apiVersion')