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

Add Param after_id #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 15 additions & 3 deletions venmo_api/apis/user_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,25 @@ def get_user_friends_list(self, user_id: str = None,
def get_user_transactions(self, user_id: str = None, user: User = None,
callback=None,
limit: int = 50,
after_id=None,
before_id=None) -> Union[Page, None]:
"""
Get ([user_id]'s or [user]'s) transactions visible to yourself as a list of <Transaction>s
Get ([user_id]'s or [user]'s) transactions visible to yourself as a list of <Transaction>s.
Get a range of transactions when after_id < before_id.
:param user_id:
:param user:
:param callback:
:param limit:
:param before_id:
:param after_id: <str>, Story transaction id; example: '4161503637825867150'
:param before_id: <str>, Story transaction id; example: '4161503637825867155'
:return:
"""
user_id = get_user_id(user, user_id)

params = {'limit': limit}
if after_id:
params['after_id'] = after_id

if before_id:
params['before_id'] = before_id

Expand All @@ -176,23 +182,29 @@ def get_transaction_between_two_users(self, user_id_one: str = None,
user_two: User = None,
callback=None,
limit: int = 50,
after_id=None,
before_id=None) -> Union[Page, None]:
"""
Get the transactions between two users. Note that user_one must be the owner of the access token.
Otherwise it raises an unauthorized error.
Get a range of transactions when after_id < before_id.
:param user_id_one:
:param user_id_two:
:param user_one:
:param user_two:
:param callback:
:param limit:
:param before_id:
:param after_id: <str>, Story transaction id; example: '4161503637825867150'
:param before_id: <str>, Story transaction id; example: '4161503637825867155'
:return:
"""
user_id_one = get_user_id(user_one, user_id_one)
user_id_two = get_user_id(user_two, user_id_two)

params = {'limit': limit}
if after_id:
params['after_id'] = after_id

if before_id:
params['before_id'] = before_id

Expand Down