*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()