Coder Social home page Coder Social logo

venmo's Introduction

image

image

Venmo

Pay or charge people on the command line!

$ venmo pay @zackhsi 23.19 "Thanks for the beer <3"
$ venmo charge 19495551234 23.19 "That beer wasn't free!"

Installation

venmo can be installed via pip.

$ pip install venmo

Setup

Set up venmo by running:

$ venmo configure

> Venmo email [None]: [email protected]
> Venmo password [None]:
> Verification code: 908126  # for 2 factor authentication

That's it!

Contributing

Pull requests welcome! To get started, first clone the repository:

$ git clone [email protected]:zackhsi/venmo.git

Create a virtualenv containing an editable installation of venmo, plus development dependencies:

$ make init

Activate the virtualenv:

$ pipenv shell

Run tests:

$ make test

venmo's People

Contributors

alexgleason avatar zackhsi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

venmo's Issues

multiple recipients, email address as recipient,

Hi,
Thank you for the great repo, you saved a ton of my time. ;)
It seems like we can only pay or request to one person.
Also, I collected email addresses to charge. But it looks like email address is not supported to pay or charge.
I was wondering if you have any plan to implement multiple recipients or email address as recipient.
Any comment will be appreciated.
Thanks!
Kyu

Payments fails with 403

I got this error: venmo.payment: ERROR Could not find user @Dashed-Username.

After using this command: venmo pay @Dashed-Username 100 "๐Ÿ˜€"

I've paid this (obfuscated) user before successfully on the desktop and iPhone app and I can find them using venmo search Dashed-Username.

Would love the option to transfer venmo balance to my bank!

We have a dedicated account that accepts venmo payment for our rent. This needs to get transferred to a bank account where the actual rent check gets sent.

If this isn't on anyone radar already, I try implementing this, in which case, pointers are welcome.

Balance fetching stopped working

I've been using a customization of this venmo api for a while, because I only wanted my application to be able to fetch the balance for a single account (over and over on a scheduled task). I've done so with the following code:

if not venmo.auth.configure():
    print("Venmo configuration failed.")
    return

access_token = venmo.auth.get_access_token()

data = {"access_token": access_token}
response = requests.get("https://api.venmo.com/v1/me", json=data)

try:
    return float(response.json()["data"]["balance"])
except KeyError:
    print("Access token has expired. Returning None.")
    return None

However I just realized this stopped working. Now the response of the GET is a 403 Forbidden, saying the request could not be satisfied, bad request. The documentation online for the api is pretty sparse so I couldn't find anything, but I was wondering if you had any insights on this issue?

Call on id_from_username(username.lower()) fails

user_id = venmo.user.id_from_username(username.lower())

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.

Save username/password

Replace venmo refresh-token with venmo configure, similar to aws configure. Store credentials in ~/.venmo or something like that.

Could not make the request because -> 403 Forbidden

Do you know if Venmo updated their API recently?

I've been using your package for the past 6 months or so and haven't changed any code but noticed I'm now getting a 403 error ๐Ÿค”

  File "/home/runner/work/monthly-venmo/monthly-venmo/health.py", line 97, in <module>
    main(now)
  File "/home/runner/work/monthly-venmo/monthly-venmo/health.py", line 22, in main
    venmo = Venmo(access_token)
  File "/home/runner/work/monthly-venmo/monthly-venmo/utils.py", line 65, in __init__
    self.client = Client(access_token=access_token)
  File "/opt/hostedtoolcache/Python/3.9.8/x64/lib/python3.9/site-packages/venmo_api/venmo.py", line 15, in __init__
    self.__profile = self.user.get_my_profile()
  File "/opt/hostedtoolcache/Python/3.9.8/x64/lib/python3.9/site-packages/venmo_api/apis/user_api.py", line 26, in get_my_profile
    response = self.__api_client.call_api(resource_path=resource_path,
  File "/opt/hostedtoolcache/Python/3.9.8/x64/lib/python3.9/site-packages/venmo_api/utils/api_client.py", line 58, in call_api
    return self.__call_api(resource_path=resource_path, method=method,
  File "/opt/hostedtoolcache/Python/3.9.8/x64/lib/python3.9/site-packages/venmo_api/utils/api_client.py", line 103, in __call_api
    processed_response = self.request(method, url, session,
  File "/opt/hostedtoolcache/Python/3.9.8/x64/lib/python3.9/site-packages/venmo_api/utils/api_client.py", line 139, in request
    validated_response = self.__validate_response(response, ok_error_codes=ok_error_codes)
  File "/opt/hostedtoolcache/Python/3.9.8/x64/lib/python3.9/site-packages/venmo_api/utils/api_client.py", line 170, in __validate_response
    raise HttpCodeError(response=response)
venmo_api.models.exception.HttpCodeError: HTTP Status code is invalid. Could not make the request because -> 403 Forbidden.
Error: Invalid Json

Link to error
Link to code

Possibly related #55

Venmo Charge isn't working; keyerror: id

Hi, recently, venmo charge hasn't been working. status, reset, etc work fine. uninstalled and reinstalled, still have the same issues.

See error log below.

My venmo is opeoo if you want to use it to test.

Thanks.

โžœ work venmo charge @justin-love-2 0.01 "test"
Traceback (most recent call last):
File "/usr/local/bin/venmo", line 10, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/venmo/cli.py", line 96, in main
parse_args()
File "/usr/local/lib/python2.7/dist-packages/venmo/cli.py", line 91, in parse_args
func(**vars(args))
File "/usr/local/lib/python2.7/dist-packages/venmo/payment.py", line 20, in charge
_pay_or_charge(user, amount, note)
File "/usr/local/lib/python2.7/dist-packages/venmo/payment.py", line 39, in _pay_or_charge
user_id = venmo.user.id_from_username(username)
File "/usr/local/lib/python2.7/dist-packages/venmo/user.py", line 12, in id_from_username
for u in search(username):
File "/usr/local/lib/python2.7/dist-packages/venmo/user.py", line 34, in search
'id': u['id'],
KeyError: 'id'

Add -f flag to configure

venmo configure shouldn't refresh token if the token is recent.

venmo configure -f or venmo configure --force should.

Venmo configure not working

Log:

venmo configure
Venmo email [None]: [email protected]
Venmo password [None]: *********
Traceback (most recent call last):
  File "/home/oooseun/.local/bin/venmo", line 10, in <module>
    sys.exit(main())
  File "/home/oooseun/.local/lib/python2.7/site-packages/venmo/cli.py", line 96, in main
    parse_args()
  File "/home/oooseun/.local/lib/python2.7/site-packages/venmo/cli.py", line 91, in parse_args
    func(**vars(args))
  File "/home/oooseun/.local/lib/python2.7/site-packages/venmo/auth.py", line 52, in configure
    success = submit_credentials(email, password)
  File "/home/oooseun/.local/lib/python2.7/site-packages/venmo/auth.py", line 229, in submit_credentials
    root = ET.fromstring(filtered_xml)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1311, in XML
    parser.feed(text)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1659, in feed
    self._raiseerror(v)
  File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1523, in _raiseerror
    raise err
xml.etree.ElementTree.ParseError: mismatched tag: line 5, column 2

Access Token Timing out?

Have you heard of/had any issues yourself of the access_token in ~/.venmo/credentials timing out?

I'm getting the following error:

pi@raspberrypi:~/Recurring_Venmo $ venmo charge <user_im_trying_to_charge> 1.00 'test'

Traceback (most recent call last):
  File "/home/pi/.local/bin/venmo", line 10, in <module>
    sys.exit(main())
  File "/home/pi/.local/lib/python3.7/site-packages/venmo/cli.py", line 96, in main
    parse_args()
  File "/home/pi/.local/lib/python3.7/site-packages/venmo/cli.py", line 91, in parse_args
    func(**vars(args))
  File "/home/pi/.local/lib/python3.7/site-packages/venmo/payment.py", line 20, in charge
    _pay_or_charge(user, amount, note)
  File "/home/pi/.local/lib/python3.7/site-packages/venmo/payment.py", line 35, in _pay_or_charge
    user_id = venmo.user.id_from_username(username)
  File "/home/pi/.local/lib/python3.7/site-packages/venmo/user.py", line 12, in id_from_username
    for u in search(username):
  File "/home/pi/.local/lib/python3.7/site-packages/venmo/user.py", line 39, in search
    users = response.json()['data']
KeyError: 'data'

However, if I reconfigure from the CL using venmo configure, enter password and code that is texted to me, everything works fine with the same command. Any ideas what's happening?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.