Venmo-api

Latest version: v0.3.1

Safety actively analyzes 688896 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.3.1

*Released 2021-05-23*

* Added a payment status 27
* Added comments to the Transaction model 29
* Added a payment method 34

0.3.0

*Released 2021-01-08*

* Added pagination support for the `user_api`. Here is an example:

* python
transactions = client.user.get_user_transactions('a user id here')

page_counter = 1
while transactions:
print("Page:", page_counter, " size:", len(transactions))
page_counter += 1

print all the transactions
for transaction in transactions:
print(transaction)

get the next page
transactions = transactions.get_next_page()
print("Next page\n")



* Added `to_json` method for the models. `to_json` will give you the original JSON returned by Venmo for a model (e.g., Transaction, User)

* Added `get_user_by_username` to the `user_api`

* Updated the token validator and fixed (20)

* Added `failed` payment status (25)

* Added check for balance when calling `send_money()`. If you get a `NotEnoughBalanceError`, either use another `payment_id` or transfer money to your Venmo balance/default payment method. You can get a list of your `payment_methods` by running the following:

* python
payment_methods = client.payment.get_payment_methods()
for payment_method in payment_methods:
print(payment_method.to_json())


* Fixed a bug with `device_used` in the transaction JSON when a device other than iPhone or Android was used for the transaction.

0.2.2

*Released 2020-10-03*

* Fixed (19). There are only bank_accounts and venmo balance supported as a `payment_method`. More to be added later on.
* Made a BaseModel for string methods
* You can now pass a limit for getting charge/pay payments; example: `client.payment.get_charge_payments(limit=50)`

0.2.0

*Released 2020-09-23*

* Fixed a typo (15)
* Added getting payments functionality
* `client.payment.get_charge_payments()`
* `client.payment.get_pay_payments()`
* Added updating a payment
* `client.payment.remind_payment()` send a reminder for a given payment (13)
* `client.payment.cancel_payment()` cancel the payment
* Added manual authentication capability. You can now do the authentication process (getting an access token) manually. Here is an example of doing so (12):
python3
def manually_login(username: str, password: str, device_id: str = None):

You can use trusted device-id stored from before, pass it to AuthenticationApi(device_id="some id")
auth = AuthenticationApi(device_id=device_id)
response = auth.authenticate_using_username_password(username, password)

this happens if you've used a trusted device-id
if not response.get('body').get('error'):
access_token = response['body']['access_token']
return access_token and device_id used for auth
return access_token, auth.get_device_id()

2-factor-auth process
otp_secret = response['headers'].get('venmo-otp-secret')
if not otp_secret:
raise AuthenticationFailedError("Failed to get the otp-secret for the 2-factor authentication process. "
"(check your password)")

auth.send_text_otp(otp_secret=otp_secret)
TODO: Update the user otp here, however you'd like to do so
An example is prompting user for an input, like user_otp = input("Enter OTP: ")
user_otp = "The one-time-password that user receives on their phone (sms) goes here"

access_token = auth.authenticate_using_otp(user_otp, otp_secret)

OPTIONAL
if you want, you can add the random device-id generated to the list of trusted devices by doing the following
Important: auth_api needs access_token you've received for trusting the device-id
auth.set_access_token(access_token=access_token)
trusts the device-id used for authentication
auth.trust_this_device()

return access_token, auth.get_device_id()

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.