Browse Source

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

* hw_telium_payment_terminal: Update to newer pycountry API
pull/471/head
Alexis de Lattre 7 years ago
committed by Florent de Labarre
parent
commit
92df9cb011
  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',
'version': '8.0.0.1.0',
'version': '8.0.0.1.1',
'category': 'Hardware Drivers',
'license': 'AGPL-3',
'summary': 'Adds support for Payment Terminals using Telium protocol',
@ -66,6 +66,11 @@ This module has been successfully tested with:
* Ingenico iCT250
* 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
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/.

2
hw_telium_payment_terminal/controllers/main.py

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

Loading…
Cancel
Save