Browse Source

Merge PR #391 into 8.0

Signed-off-by pedrobaeza
pull/422/head
OCA-git-bot 5 years ago
parent
commit
9e6a32c763
  1. 2
      hw_telium_payment_terminal/__openerp__.py
  2. 12
      hw_telium_payment_terminal/controllers/main.py

2
hw_telium_payment_terminal/__openerp__.py

@ -23,7 +23,7 @@
{ {
'name': 'Hardware Telium Payment Terminal', 'name': 'Hardware Telium Payment Terminal',
'version': '8.0.0.1.1',
'version': '8.0.0.1.2',
'category': 'Hardware Drivers', 'category': 'Hardware Drivers',
'license': 'AGPL-3', 'license': 'AGPL-3',
'summary': 'Adds support for Payment Terminals using Telium protocol', 'summary': 'Adds support for Payment Terminals using Telium protocol',

12
hw_telium_payment_terminal/controllers/main.py

@ -239,6 +239,15 @@ class TeliumPaymentTerminalDriver(Thread):
self.device_name, self.device_rate, self.device_name, self.device_rate,
timeout=3) timeout=3)
logger.debug('serial.is_open = %s' % self.serial.isOpen()) logger.debug('serial.is_open = %s' % self.serial.isOpen())
if self.serial.isOpen():
self.set_status("connected",
"Connected to {}".format(self.device_name))
else:
self.set_status("disconnected",
"Could not connect to {}"
.format(self.device_name))
if self.initialize_msg(): if self.initialize_msg():
data = self.prepare_data_to_send(payment_info_dict) data = self.prepare_data_to_send(payment_info_dict)
if not data: if not data:
@ -257,6 +266,9 @@ class TeliumPaymentTerminalDriver(Thread):
except Exception, e: except Exception, e:
logger.error('Exception in serial connection: %s' % str(e)) logger.error('Exception in serial connection: %s' % str(e))
self.set_status("error",
"Exception in serial connection to {}"
.format(self.device_name))
finally: finally:
if self.serial: if self.serial:
logger.debug('Closing serial port for payment terminal') logger.debug('Closing serial port for payment terminal')

Loading…
Cancel
Save