diff --git a/.gitignore b/.gitignore
index c7c7428..830ddaf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,4 @@ build
 
 __pycache__
 *.pyc
+.cache
diff --git a/.travis.yml b/.travis.yml
index 1ed605c..bfd2407 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,3 +7,4 @@ install:
   - make init
 script:
   - flake8
+  - make test
diff --git a/Makefile b/Makefile
index f3bdd59..08f2575 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
 init:
 	pip install pipenv --upgrade
 	pipenv install --dev --skip-lock
+
+test:
+	py.test --disable-socket tests
diff --git a/Pipfile b/Pipfile
index e91b975..32fa1ce 100644
--- a/Pipfile
+++ b/Pipfile
@@ -13,3 +13,6 @@ venmo = {path = ".", editable = true}
 [dev-packages]
 
 flake8 = "*"
+pytest = "*"
+pytest-socket = "*"
+mock = "*"
diff --git a/venmo/payment.py b/venmo/payment.py
index e2f49a8..950ddec 100644
--- a/venmo/payment.py
+++ b/venmo/payment.py
@@ -36,11 +36,11 @@ def _pay_or_charge(user, amount, note):
     }
     if user.startswith('@'):
         username = user[1:]
-        user_id = venmo.user.id_from_username(username.lower())
+        user_id = venmo.user.id_from_username(username)
         if not user_id:
             logger.error('Could not find user @{}'.format(username))
             return
-        data['user_id'] = user_id.lower()
+        data['user_id'] = user_id
     else:
         data['phone'] = user
 
diff --git a/venmo/user.py b/venmo/user.py
index 978f91e..4875ea3 100644
--- a/venmo/user.py
+++ b/venmo/user.py
@@ -10,7 +10,7 @@ import venmo
 
 def id_from_username(username):
     for u in search(username):
-        if u['username'] == username:
+        if u['username'].lower() == username.lower():
             return u['id']
     return None
 

Call on id_from_username(username.lower()) fails
https://github.com/zackhsi/venmo/blob/86cfe5d3b2a962d42c90b9d39b5e251c205156d0/venmo/payment.py#L39

Because the line linked above makes the call on `username.lower()`, it looks this call will never return an id for a username that has uppercase letters, because `id_from_username` makes a comparison between the string passed to the function (in this case a lowercase forced string) and the username string returned by venmo. So a function call of `id_from_username('myusername')` for a username that is actually MyUserName will compare MyUserName to myusername and thus return None.
diff --git a/tests/user_test.py b/tests/user_test.py
new file mode 100644
index 0000000..60caf70
--- /dev/null
+++ b/tests/user_test.py
@@ -0,0 +1,31 @@
+import sys
+
+import venmo
+
+if sys.version_info <= (3, 3):
+    import mock
+else:
+    from unittest import mock
+
+
+@mock.patch.object(venmo.user, 'search')
+def test_id_from_username_case_insensitive(mock_search):
+    # Mock out Venmo API response. It is case insensitive.
+    mock_search.return_value = [
+        {
+            "id": "975376293560320029",
+            "username": "zackhsi",
+            "display_name": "Zack Hsi",
+            "profile_picture_url": "https://venmopics.appspot.com/u/v2/f/172a1500-63f5-4d78-b15a-a06dc9c0ad82"  # noqa
+        },
+    ]
+
+    ids = [
+        venmo.user.id_from_username('zackhsi'),
+        venmo.user.id_from_username('Zackhsi'),
+        venmo.user.id_from_username('ZACKHSI'),
+    ]
+    # Assert that all return ids.
+    assert all(ids)
+    # Assert that the same id is returned.
+    assert len(set(ids)) == 1

pip install -e .[dev]
parse_log_pytest
pytest
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
charset-normalizer==2.0.12
coverage==6.2
execnet==1.9.0
idna==3.10
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
pytest-asyncio==0.16.0
pytest-cov==4.0.0
pytest-mock==3.6.1
pytest-xdist==3.0.2
requests==2.27.1
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
tomli==1.2.3
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
urllib3==1.26.20
-e git+https://github.com/zackhsi/venmo.git@86cfe5d3b2a962d42c90b9d39b5e251c205156d0#egg=venmo
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: venmo
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - charset-normalizer==2.0.12
      - coverage==6.2
      - execnet==1.9.0
      - idna==3.10
      - pytest-asyncio==0.16.0
      - pytest-cov==4.0.0
      - pytest-mock==3.6.1
      - pytest-xdist==3.0.2
      - requests==2.27.1
      - tomli==1.2.3
      - urllib3==1.26.20
prefix: /opt/conda/envs/venmo

tests/user_test.py::test_id_from_username_case_insensitive
Makefile .gitignore .travis.yml Pipfile venmo/payment.py venmo/user.py
Makefile .gitignore .travis.yml Pipfile venmo/payment.py venmo/user.py