Browse Source

[8.0] hw_telium_payment_terminal: Update to newer pycountry API (#222)

* hw_telium_payment_terminal: Update to newer pycountry API
pull/229/head
Alexis de Lattre 7 years ago
committed by Sylvain LE GAL
parent
commit
3c552338da
  1. 7
      hw_telium_payment_terminal/__openerp__.py
  2. 2
      hw_telium_payment_terminal/controllers/main.py
  3. 2
      hw_telium_payment_terminal/test-scripts/telium-test.py

7
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.0',
'version': '8.0.0.1.1',
'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',
@ -66,6 +66,11 @@ This module has been successfully tested with:
* Ingenico iCT250 * Ingenico iCT250
* Ingenico i2200 cheque reader and writer * Ingenico i2200 cheque reader and writer
This module requires the Python library *pycountry* version >= 16.11.08.
To install it, run:
sudo pip install pycountry
This module has been developped during a POS code sprint at Akretion This module has been developped during a POS code sprint at Akretion
France from July 7th to July 10th 2014. This module is part of the POS France from July 7th to July 10th 2014. This module is part of the POS
project of the Odoo Community Association http://odoo-community.org/. project of the Odoo Community Association http://odoo-community.org/.

2
hw_telium_payment_terminal/controllers/main.py

@ -131,7 +131,7 @@ class TeliumPaymentTerminalDriver(Thread):
return False return False
cur_iso_letter = payment_info_dict['currency_iso'].upper() cur_iso_letter = payment_info_dict['currency_iso'].upper()
try: try:
cur = pycountry.currencies.get(letter=cur_iso_letter)
cur = pycountry.currencies.get(alpha_3=cur_iso_letter)
cur_numeric = str(cur.numeric) cur_numeric = str(cur.numeric)
except: except:
logger.error("Currency %s is not recognized" % cur_iso_letter) logger.error("Currency %s is not recognized" % cur_iso_letter)

2
hw_telium_payment_terminal/test-scripts/telium-test.py

@ -85,7 +85,7 @@ def prepare_data_to_send():
return False return False
cur_iso_letter = CURRENCY_ISO.upper() cur_iso_letter = CURRENCY_ISO.upper()
try: try:
cur = pycountry.currencies.get(letter=cur_iso_letter)
cur = pycountry.currencies.get(alpha_3=cur_iso_letter)
cur_numeric = str(cur.numeric) cur_numeric = str(cur.numeric)
except: except:
print "Currency %s is not recognized" % cur_iso_letter print "Currency %s is not recognized" % cur_iso_letter

Loading…
Cancel
Save