From 92df9cb011c3bca815b98ca36de54503a4ad5a92 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 13 Nov 2017 09:37:35 +0100 Subject: [PATCH] [8.0] hw_telium_payment_terminal: Update to newer pycountry API (#222) * hw_telium_payment_terminal: Update to newer pycountry API --- hw_telium_payment_terminal/__openerp__.py | 7 ++++++- hw_telium_payment_terminal/controllers/main.py | 2 +- hw_telium_payment_terminal/test-scripts/telium-test.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hw_telium_payment_terminal/__openerp__.py b/hw_telium_payment_terminal/__openerp__.py index 31116ea1..860026b0 100644 --- a/hw_telium_payment_terminal/__openerp__.py +++ b/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/. diff --git a/hw_telium_payment_terminal/controllers/main.py b/hw_telium_payment_terminal/controllers/main.py index 8bd11ede..e6b35027 100644 --- a/hw_telium_payment_terminal/controllers/main.py +++ b/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) diff --git a/hw_telium_payment_terminal/test-scripts/telium-test.py b/hw_telium_payment_terminal/test-scripts/telium-test.py index ee94e3cd..28c50701 100755 --- a/hw_telium_payment_terminal/test-scripts/telium-test.py +++ b/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