mmohades / Venmo

Venmo API client for Python
GNU General Public License v3.0
145 stars 43 forks source link

Allow ability to complete a payment request #68

Open AdamWHuffman opened 2 years ago

AdamWHuffman commented 2 years ago

Currently see that cancel and get are options for payments. I fam unsure if the api supports a PUT complete for example, but that would be super useful. Unsure how how to discover more actions as Venmo's api isn't documented anywhere to my understanding.

mmohades commented 2 years ago

I'll have to look into it. Do you need this feature?

AdamWHuffman commented 2 years ago

Would be super helpful. I have a Venmo manager I made that makes use of this project that can send requests and it would be great to add the ability to completing them.

I know the API docs you have support the ability to "cancel", but I've been trying a bunch of other things like "complete" or "settle" but haven't had any luck yet. Not sure if you know how to scrape it for more API routes/actions.

Davis8483 commented 6 months ago

Any update, I need the same feature for my project. The only workaround I can think of would be to detect a payment and cancel it. Then use the username to send a request, and detect when that request is accepted. However, that would be very janky for the end user.

(Edit: I thought when sending a venmo payment the recipient had to accept it, so please ignore the rambling about the janky solution)

Davis8483 commented 6 months ago

Venmo Docs - Complete a Payment Request The docs list the valid actions as approve, deny, or cancel

Now, if we trace back the cancel_payment() method in the python library we find that it calls self.__update_payment(action="cancel", payment_id=payment_id)

So one would assume you could call this instead with the approve or deny action.

self.venmo = Client(access_token="Your access token")

// grab first payment in the list
my_payment = self.venmo.payment.get_charge_payments(limit=1)[0]

// approve the payment
self.venmo.payment.__update_payment("approve", my_payment)

note: this code is untested, just throwing around ideas