mmohades / Venmo

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

Feature request: Add "action" to transaction class #45

Closed cjappl closed 3 years ago

cjappl commented 3 years ago

I'd like to request the "action" member be available in the transaction class.

Happy to circle back and take care of this myself after I'm done with this project.

You can reference it now by: transaction._json['payment']['action']

Looks like it is 'charge' or 'pay'

It would be nice to be able to specifically look at actor or target based on the action:

if transaction.action == 'pay' and transaction.target.display_name == 'my friend':
   ...
if transaction.action == 'charge' and transaction.actor.display_name == 'my friend:
 ...

right now, I have to check both, because I can't be sure which direction the transaction is flowing: if transaction.target.display_name == 'my friend' or transaction.actor.display_name == 'my friend'

Not a massive deal, in the large scale of things, but I'd definitely use it :)

Thanks for all your work on this project, it's so helpful!

mmohades commented 3 years ago

You may access it in the transaction.payment_type

mmohades commented 3 years ago

The target and actor work a little differently. The actor can request money, or can send money. Being the actor just shows that that was the user that initiated the transaction.

cjappl commented 3 years ago

Got it! I missed that one. Thanks for the help!