Skip to content

Commit

Permalink
Fixed #5; A bug with Venmo debit card transactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
will-holley authored and mmohades committed Jun 22, 2020
1 parent 6199ebc commit 6d6bdaa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def requirements():

setup(
name='venmo-api',
version='0.1.5',
version='0.1.6',
author="Mark Mohades",
license="GNU General Public License v3",
url='https://github.com/mmohades/venmo',
Expand Down
12 changes: 10 additions & 2 deletions venmo_api/models/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def from_json(cls, json):
parser = JSONSchema.transaction(json)
transaction_type = TransactionType(parser.get_transaction_type())

# Skip money transfers to/from bank accounts and refunds
if transaction_type == TransactionType.REFUND or transaction_type == TransactionType.TRANSFER:
# Currently only handles Payment-type transactions
if transaction_type is not TransactionType.PAYMENT:
return

date_created = string_to_timestamp(parser.get_date_created())
Expand Down Expand Up @@ -83,5 +83,13 @@ def __str__(self):

class TransactionType(Enum):
PAYMENT = 'payment'
# merchant refund
REFUND = 'refund'
# to/from bank account
TRANSFER = 'transfer'
# add money to debit card
TOP_UP = 'top_up'
# debit card purchase
AUTHORIZATION = 'authorization'
# debit card atm withdrawal
ATM_WITHDRAWAL = 'atm_withdrawal'

0 comments on commit 6d6bdaa

Please sign in to comment.