Libraries refactor and add some sinks #4

Closed
m wants to merge 136 commits from library-refactor into master
1 changed files with 6 additions and 0 deletions
Showing only changes of commit 0d85d19ab9 - Show all commits

View File

@ -46,6 +46,9 @@ class Transactions(object):
self.log.error("Type not in inside: {inside}", inside=inside) self.log.error("Type not in inside: {inside}", inside=inside)
return return
txtype = inside["type"] txtype = inside["type"]
if txtype == "card_payment":
self.log.info("Ignoring card payment: {id}", id=txid)
return
state = inside["state"] state = inside["state"]
if "reference" in inside: if "reference" in inside:
reference = inside["reference"] reference = inside["reference"]
@ -60,6 +63,9 @@ class Transactions(object):
account_type = "not_given" account_type = "not_given"
amount = leg["amount"] amount = leg["amount"]
if amount <= 0:
self.log.info("Ignoring transaction with negative/zero amount: {id}", id=txid)
return
currency = leg["currency"] currency = leg["currency"]
description = leg["description"] description = leg["description"]