summaryrefslogtreecommitdiffstats
path: root/bitvend/processor.py
diff options
context:
space:
mode:
authorPiotr Dobrowolski <admin@tastycode.pl>2017-04-04 23:56:42 +0200
committerPiotr Dobrowolski <admin@tastycode.pl>2017-04-05 00:26:26 +0200
commit32caeed871a88c7e6fbb63c38cf453e5dec3a0f8 (patch)
treea5a17400e020e3085d989ea425f955eb86440b6c /bitvend/processor.py
parentf2eb24aeac4507232357e988e418fa08ccfdbe17 (diff)
downloadbitvend-32caeed871a88c7e6fbb63c38cf453e5dec3a0f8.tar.gz
bitvend-32caeed871a88c7e6fbb63c38cf453e5dec3a0f8.tar.bz2
bitvend-32caeed871a88c7e6fbb63c38cf453e5dec3a0f8.tar.xz
bitvend-32caeed871a88c7e6fbb63c38cf453e5dec3a0f8.zip
Rewrite, user authentication
Diffstat (limited to 'bitvend/processor.py')
-rw-r--r--bitvend/processor.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/bitvend/processor.py b/bitvend/processor.py
index 40313f7..58df9b7 100644
--- a/bitvend/processor.py
+++ b/bitvend/processor.py
@@ -64,7 +64,9 @@ class PaymentProcessor(threading.Thread):
with self.app.app_context():
tx = Transaction(tx_hash=tx_hash)
- tx.value = to_local_currency(tx_value)
+ tx.uid = '__bitcoin__'
+ tx.amount = -to_local_currency(tx_value)
+ tx.type = 'purchase'
db.session.add(tx)
db.session.commit()
@@ -79,9 +81,9 @@ class PaymentProcessor(threading.Thread):
self.logger.info('Transaction ok, going to device...')
# FIXME we need better handling of ACK on POLL responses...
- self.device.begin_session(to_local_currency(tx_value), tx_hash)
- self.device.begin_session(to_local_currency(tx_value), tx_hash)
- self.device.begin_session(to_local_currency(tx_value), tx_hash)
+ self.device.begin_session(to_local_currency(tx_value), tx.id)
+ self.device.begin_session(to_local_currency(tx_value), tx.id)
+ self.device.begin_session(to_local_currency(tx_value), tx.id)
def on_message(self, ws, message):
#print message