Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a KeyError: 'card' when attemptig to make a payment #19

Closed
ammo414 opened this issue Oct 3, 2020 · 1 comment
Closed

Getting a KeyError: 'card' when attemptig to make a payment #19

ammo414 opened this issue Oct 3, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ammo414
Copy link

ammo414 commented Oct 3, 2020

The following is the code I'm trying to run:

from venmo_api import Client

access_tok = Client.get_access_token('email', 'password', '2fa')
venmo = Client(access_token=access_tok)

venmo.payment.send_money(int, 'comment', 'recipientid')

venmo.log_out(access_tok)

The following is the traceback:

Traceback (most recent call last):
  File "payment.py", line 6, in <module>
    venmo.payment.send_money(int, 'comment', 'recipientid')
  File "/home/USER/anaconda3/lib/python3.8/site-packages/venmo_api/apis/payment_api.py", line 54, in send_money
    return self.__send_or_request_money(amount=amount,
  File "/home/USER/anaconda3/lib/python3.8/site-packages/venmo_api/apis/payment_api.py", line 122, in __send_or_request_money
    funding_source_id = self.get_default_payment_method().id
  File "/home/USER/anaconda3/lib/python3.8/site-packages/venmo_api/apis/payment_api.py", line 144, in get_default_payment_method
    payment_methods = self.get_payment_methods()
  File "/home/USER/anaconda3/lib/python3.8/site-packages/venmo_api/apis/payment_api.py", line 32, in get_payment_methods
    return deserialize(response=response, data_type=PaymentMethod)
  File "/home/USER/anaconda3/lib/python3.8/site-packages/venmo_api/utils/api_util.py", line 43, in deserialize
    return __get_objs_from_json_list(json_list=data, data_type=data_type)
  File "/home/USER/anaconda3/lib/python3.8/site-packages/venmo_api/utils/api_util.py", line 77, in __get_objs_from_json_list
    data_obj = data_type.from_json(obj)
  File "/home/USER/anaconda3/lib/python3.8/site-packages/venmo_api/models/payment_method.py", line 26, in from_json
    payment_class = payment_type[p_type]
KeyError: 'card'
@ammo414 ammo414 changed the title Getting aKeyError: 'card' when attemptig to make a payment Getting a KeyError: 'card' when attemptig to make a payment Oct 3, 2020
@mmohades mmohades added the bug Something isn't working label Oct 3, 2020
@mmohades mmohades self-assigned this Oct 3, 2020
@mmohades
Copy link
Owner

mmohades commented Oct 3, 2020

Thanks for opening an issue. This was caused by a card payment_method, that is currently not supported. It should be fixed in the new version. Update your venmo-api using pip3 install venmo-api --upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants