odoo-driver-plugin-payment-telium 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (16) hide show
  1. odoo_driver_plugin_payment_telium-1.1.0/PKG-INFO +94 -0
  2. odoo_driver_plugin_payment_telium-1.1.0/README.md +66 -0
  3. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/__init__.py +17 -0
  4. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/i18n/babel.cfg +2 -0
  5. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/i18n/fr/LC_MESSAGES/messages.mo +0 -0
  6. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/i18n/fr/LC_MESSAGES/messages.po +41 -0
  7. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/i18n/messages.pot +40 -0
  8. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/payment_telium_driver.py +31 -0
  9. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/payment_telium_route_odoo.py +27 -0
  10. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/payment_telium_route_website.py +15 -0
  11. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/static/img/generic_device.png +0 -0
  12. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/static/img/ingenico__desk_5000.png +0 -0
  13. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/static/img/ingenico__move_5000.png +0 -0
  14. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/templates/payment_telium_driver.html.jinja +44 -0
  15. odoo_driver_plugin_payment_telium-1.1.0/odoo_driver_plugin_payment_telium/usb_devices.py +10 -0
  16. odoo_driver_plugin_payment_telium-1.1.0/pyproject.toml +50 -0
@@ -0,0 +1,94 @@
1
+ Metadata-Version: 2.4
2
+ Name: odoo-driver-plugin-payment-telium
3
+ Version: 1.1.0
4
+ Summary: Plugin for odoo-driver. Support Telium payment terminal devices. (Ingenico ®, etc...)
5
+ License: AGPLv3+
6
+ Keywords: Odoo,Point Of Sale,Driver,Device,Payment,Telium,Ingenico ®
7
+ Author: Sylvain LE GAL
8
+ Author-email: sylvain.legal@grap.coop
9
+ Maintainer: Sylvain LE GAL
10
+ Maintainer-email: sylvain.legal@grap.coop
11
+ Requires-Python: >=3.9,<4.0
12
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Operating System :: Unix
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Framework :: Odoo
23
+ Requires-Dist: odoo-driver
24
+ Requires-Dist: pyteliummanager
25
+ Project-URL: Repository, https://gitlab.com/grap-rhone-alpes/odoo-driver-plugin-payment-telium
26
+ Description-Content-Type: text/markdown
27
+
28
+ # Odoo Driver Plugin - Payment Terminal - Ingenico
29
+
30
+ ![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)
31
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/odoo-driver-plugin-payment-terminal)
32
+ ![PyPI - Downloads](https://img.shields.io/pypi/dm/odoo-driver-plugin-payment-terminal)
33
+ ![GitLab last commit](https://img.shields.io/gitlab/last-commit/81577360)
34
+ ![GitLab stars](https://img.shields.io/gitlab/stars/81577360?style=social)
35
+
36
+
37
+ This project provide a plugin for ``odoo-driver``
38
+ to communicate with Payment Terminal with Telium protocol.
39
+
40
+ This plugin requires the following odoo module : [`pos_odoo_driver_payment`](https://github.com/grap/odoo-addons-pos)
41
+
42
+ To install this plugin, refer to the main project page : https://gitlab.com/grap-rhone-alpes/odoo-driver/.
43
+
44
+ For developpers, refer to this page : https://gitlab.com/grap-rhone-alpes/odoo-driver-plugin-printer-escpos/-/blob/main/DEVELOP.md.
45
+
46
+ ## Table of contents
47
+
48
+ 1. [Compatible Devices](#compatible-devices)
49
+ 2. [Credits](#credits)
50
+
51
+
52
+ <a name="compatible-devices"></a>
53
+
54
+ ## Compatible Devices
55
+
56
+ <table style="width: 100%;">
57
+ <tbody>
58
+ <tr>
59
+ <td>Ingenico - Desk/5000</td>
60
+ <td>
61
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver-plugin-payment-telium/-/raw/main/odoo_driver_plugin_payment_telium/static/img/ingenico__desk_5000.png" width="200" height="200" />
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td>Ingenico - Move/5000</td>
66
+ <td>
67
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver-plugin-payment-telium/-/raw/main/odoo_driver_plugin_payment_telium/static/img/ingenico__move_5000.png" width="200" height="200" />
68
+ </td>
69
+ </tr>
70
+ </tbody>
71
+ </table>
72
+
73
+ <a name="credits"></a>
74
+
75
+ ## Credits
76
+
77
+ ### Authors
78
+
79
+ * GRAP <https://www.grap.coop>
80
+
81
+ ### Contributors
82
+
83
+ * Sylvain LE GAL <https://www.grap.coop/>
84
+
85
+ ### Extra authorship
86
+
87
+ Part of the code in this project comes from the following projects, including:
88
+
89
+ * [Pywebdriver](https://github.com/pywebdriver/pywebdriver) (AGPL-3.0).
90
+
91
+ ### Images
92
+
93
+ * [Credit Card Payment Terminal Icon](https://www.flaticon.com/fr/icone-gratuite/terminal-de-paiement_6137350), created by ToZ Icon (Flaticon).
94
+
@@ -0,0 +1,66 @@
1
+ # Odoo Driver Plugin - Payment Terminal - Ingenico
2
+
3
+ ![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)
4
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/odoo-driver-plugin-payment-terminal)
5
+ ![PyPI - Downloads](https://img.shields.io/pypi/dm/odoo-driver-plugin-payment-terminal)
6
+ ![GitLab last commit](https://img.shields.io/gitlab/last-commit/81577360)
7
+ ![GitLab stars](https://img.shields.io/gitlab/stars/81577360?style=social)
8
+
9
+
10
+ This project provide a plugin for ``odoo-driver``
11
+ to communicate with Payment Terminal with Telium protocol.
12
+
13
+ This plugin requires the following odoo module : [`pos_odoo_driver_payment`](https://github.com/grap/odoo-addons-pos)
14
+
15
+ To install this plugin, refer to the main project page : https://gitlab.com/grap-rhone-alpes/odoo-driver/.
16
+
17
+ For developpers, refer to this page : https://gitlab.com/grap-rhone-alpes/odoo-driver-plugin-printer-escpos/-/blob/main/DEVELOP.md.
18
+
19
+ ## Table of contents
20
+
21
+ 1. [Compatible Devices](#compatible-devices)
22
+ 2. [Credits](#credits)
23
+
24
+
25
+ <a name="compatible-devices"></a>
26
+
27
+ ## Compatible Devices
28
+
29
+ <table style="width: 100%;">
30
+ <tbody>
31
+ <tr>
32
+ <td>Ingenico - Desk/5000</td>
33
+ <td>
34
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver-plugin-payment-telium/-/raw/main/odoo_driver_plugin_payment_telium/static/img/ingenico__desk_5000.png" width="200" height="200" />
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <td>Ingenico - Move/5000</td>
39
+ <td>
40
+ <img src="https://gitlab.com/grap-rhone-alpes/odoo-driver-plugin-payment-telium/-/raw/main/odoo_driver_plugin_payment_telium/static/img/ingenico__move_5000.png" width="200" height="200" />
41
+ </td>
42
+ </tr>
43
+ </tbody>
44
+ </table>
45
+
46
+ <a name="credits"></a>
47
+
48
+ ## Credits
49
+
50
+ ### Authors
51
+
52
+ * GRAP <https://www.grap.coop>
53
+
54
+ ### Contributors
55
+
56
+ * Sylvain LE GAL <https://www.grap.coop/>
57
+
58
+ ### Extra authorship
59
+
60
+ Part of the code in this project comes from the following projects, including:
61
+
62
+ * [Pywebdriver](https://github.com/pywebdriver/pywebdriver) (AGPL-3.0).
63
+
64
+ ### Images
65
+
66
+ * [Credit Card Payment Terminal Icon](https://www.flaticon.com/fr/icone-gratuite/terminal-de-paiement_6137350), created by ToZ Icon (Flaticon).
@@ -0,0 +1,17 @@
1
+ from pathlib import Path
2
+
3
+ from single_source import get_version
4
+
5
+ from . import usb_devices
6
+ from .payment_telium_driver import DriverPaymentIngenico
7
+ from .payment_telium_route_odoo import driver_routes_odoo
8
+ from .payment_telium_route_website import driver_routes_website
9
+
10
+ __version__ = get_version(__name__, Path(__file__).parent.parent)
11
+ __package_name__ = __name__
12
+
13
+ DRIVER_FUNCTION = "payment"
14
+ PLUGIN_NAME = "payment_telium"
15
+ DRIVER_CLASS = DriverPaymentIngenico
16
+
17
+ DRIVER_ROUTES_GROUPS = [driver_routes_odoo, driver_routes_website]
@@ -0,0 +1,2 @@
1
+ [python: **.py]
2
+ [jinja2: **/templates/**.html.jinja]
@@ -0,0 +1,41 @@
1
+ # French translations for PROJECT.
2
+ # Copyright (C) 2026 ORGANIZATION
3
+ # This file is distributed under the same license as the PROJECT project.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2026.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: PROJECT VERSION\n"
9
+ "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
10
+ "POT-Creation-Date: 2026-04-25 00:07+0200\n"
11
+ "PO-Revision-Date: 2026-04-25 00:07+0200\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language: fr\n"
14
+ "Language-Team: fr <LL@li.org>\n"
15
+ "Plural-Forms: nplurals=2; plural=(n > 1);\n"
16
+ "MIME-Version: 1.0\n"
17
+ "Content-Type: text/plain; charset=utf-8\n"
18
+ "Content-Transfer-Encoding: 8bit\n"
19
+ "Generated-By: Babel 2.18.0\n"
20
+
21
+ #: payment_telium_driver.py:12
22
+ msgid "Payment Terminal"
23
+ msgstr "Terminal de paiement"
24
+
25
+ #: templates/payment_telium_driver.html.jinja:7
26
+ msgid "Test communication with payment terminal"
27
+ msgstr "Tester la communication avec le terminal de paiement"
28
+
29
+ #: templates/payment_telium_driver.html.jinja:8
30
+ #: templates/payment_telium_driver.html.jinja:15
31
+ msgid "Send Amount"
32
+ msgstr "Envoyer le montant"
33
+
34
+ #: templates/payment_telium_driver.html.jinja:10
35
+ msgid "Amount"
36
+ msgstr "Montant"
37
+
38
+ #: templates/payment_telium_driver.html.jinja:17
39
+ msgid "Technical Result"
40
+ msgstr "Résultat Technique"
41
+
@@ -0,0 +1,40 @@
1
+ # Translations template for PROJECT.
2
+ # Copyright (C) 2026 ORGANIZATION
3
+ # This file is distributed under the same license as the PROJECT project.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2026.
5
+ #
6
+ #, fuzzy
7
+ msgid ""
8
+ msgstr ""
9
+ "Project-Id-Version: PROJECT VERSION\n"
10
+ "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11
+ "POT-Creation-Date: 2026-04-25 00:07+0200\n"
12
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "MIME-Version: 1.0\n"
16
+ "Content-Type: text/plain; charset=utf-8\n"
17
+ "Content-Transfer-Encoding: 8bit\n"
18
+ "Generated-By: Babel 2.18.0\n"
19
+
20
+ #: payment_telium_driver.py:12
21
+ msgid "Payment Terminal"
22
+ msgstr ""
23
+
24
+ #: templates/payment_telium_driver.html.jinja:7
25
+ msgid "Test communication with payment terminal"
26
+ msgstr ""
27
+
28
+ #: templates/payment_telium_driver.html.jinja:8
29
+ #: templates/payment_telium_driver.html.jinja:15
30
+ msgid "Send Amount"
31
+ msgstr ""
32
+
33
+ #: templates/payment_telium_driver.html.jinja:10
34
+ msgid "Amount"
35
+ msgstr ""
36
+
37
+ #: templates/payment_telium_driver.html.jinja:17
38
+ msgid "Technical Result"
39
+ msgstr ""
40
+
@@ -0,0 +1,31 @@
1
+ from flask_babel import gettext as _
2
+ from loguru import logger
3
+ from odoo_driver.drivers.driver_abstract import DriverAbstract
4
+ from telium import Telium, TeliumAsk, manager
5
+
6
+
7
+ class DriverPaymentIngenico(DriverAbstract):
8
+ _driver_function = "payment"
9
+ _plugin_name = "payment_telium"
10
+
11
+ @property
12
+ def name(self):
13
+ return _("Payment Terminal")
14
+
15
+ def push_amount(self, amount, currency_iso):
16
+ if not self.terminal_file:
17
+ return False
18
+ telium_device = Telium(self.terminal_file)
19
+ payment = TeliumAsk.new_payment(
20
+ amount,
21
+ payment_mode="debit",
22
+ target_currency=currency_iso,
23
+ )
24
+ try:
25
+ result = telium_device.ask(payment)
26
+ except manager.TerminalInitializationFailedException as e:
27
+ logger.error(f"{type(e).__name__} - {str(e)}")
28
+ return False
29
+ finally:
30
+ telium_device.close()
31
+ return result
@@ -0,0 +1,27 @@
1
+ import simplejson
2
+ from flask import Blueprint, jsonify, request
3
+ from loguru import logger
4
+ from odoo_driver.tools.tools_interface import interface
5
+
6
+ driver_routes_odoo = Blueprint(
7
+ "route_payment_telium_odoo", __name__, template_folder="templates"
8
+ )
9
+
10
+
11
+ @driver_routes_odoo.route(
12
+ "/hw_proxy/payment_terminal_transaction_start", methods=["POST", "PUT"]
13
+ )
14
+ @logger.catch
15
+ def payment_terminal_transaction_start():
16
+ driver = interface.drivers.get("printer")
17
+ data = request.json.get("params", {}).get("payment_info", {})
18
+ interface.log_data(data, "payment", "DEBUG")
19
+
20
+ if type(data) is str:
21
+ data = simplejson.loads(data)
22
+
23
+ amount = float(data.get("amount").replace(",", "."))
24
+ currency_iso = data.get("currency_iso")
25
+
26
+ result = driver.push_amount(amount, currency_iso)
27
+ return jsonify(jsonrpc="2.0", result=result)
@@ -0,0 +1,15 @@
1
+ from flask import Blueprint, render_template
2
+ from loguru import logger
3
+ from odoo_driver.tools.tools_interface import interface
4
+
5
+ driver_routes_website = Blueprint(
6
+ "route_payment_telium_website", __name__, template_folder="templates"
7
+ )
8
+
9
+
10
+ @driver_routes_website.route("/driver/payment_telium.html")
11
+ @logger.catch
12
+ def driver_payment_telium():
13
+ print("driver_payment_telium")
14
+ driver = interface.drivers.get("payment")
15
+ return render_template("payment_telium_driver.html.jinja", driver=driver)
@@ -0,0 +1,44 @@
1
+ <!DOCTYPE html>
2
+
3
+ {% extends "layout.html.jinja" %}
4
+
5
+ {% block content %}
6
+
7
+ <h1>{{_('Test communication with payment terminal')}}</h1>
8
+ <h2>{{_('Send Amount')}}</h2>
9
+ <div class="input-group">
10
+ <span class="input-group-text">{{_('Amount')}}</span>
11
+ <input type="text" class="form-control" id="payment_amount">
12
+ <span class="input-group-text">€</span>
13
+ </div>
14
+ <div class="input-group">
15
+ <button type="button" class="btn btn-primary" onclick="test_payment(); return false;">{{_('Send Amount')}}</button>
16
+ </div>
17
+ <h2>{{_('Technical Result')}}</h2>
18
+ <textarea type="text" class="form-control" id="payment_result" readonly></textarea>
19
+
20
+ <script>
21
+
22
+ /* ***************************
23
+ Device Payment
24
+ ******************************/
25
+
26
+ $("#modal_payment").bind('shown.bs.modal', function() {
27
+ $("#payment_amount").focus();
28
+ });
29
+
30
+ function test_payment() {
31
+ const data = {
32
+ params: {
33
+ payment_info: {
34
+ amount: $("#payment_amount").val(),
35
+ currency_iso: "EUR",
36
+ },
37
+ }
38
+ }
39
+ _call_ajax("/hw_proxy/payment_terminal_transaction_start", "payment", data);
40
+ }
41
+
42
+ </script>
43
+
44
+ {% endblock %}
@@ -0,0 +1,10 @@
1
+ USB_DEVICES = {
2
+ (0x079B, 0x0028): {
3
+ "name": "Ingenico - Move/5000",
4
+ "image": "ingenico__move_5000.png",
5
+ },
6
+ (0x0B00, 0x0080): {
7
+ "name": "Ingenico - Desk/5000",
8
+ "image": "ingenico__desk_5000.png",
9
+ },
10
+ }
@@ -0,0 +1,50 @@
1
+ [project]
2
+ name = "odoo-driver-plugin-payment-telium"
3
+ version = "1.1.0"
4
+ description = """Plugin for odoo-driver. Support Telium payment terminal devices. (Ingenico ®, etc...)"""
5
+ authors = [
6
+ {name = "Sylvain LE GAL", email = "sylvain.legal@grap.coop"},
7
+ ]
8
+ maintainers = [
9
+ {name = "Sylvain LE GAL", email = "sylvain.legal@grap.coop"},
10
+ ]
11
+ readme = "README.md"
12
+ license = "AGPLv3+"
13
+ keywords = ["Odoo", "Point Of Sale", "Driver", "Device", "Payment", "Telium", "Ingenico ®"]
14
+ classifiers = [
15
+ "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
16
+ "Intended Audience :: Developers",
17
+ "Development Status :: 3 - Alpha",
18
+ "Operating System :: Unix",
19
+ "Programming Language :: Python :: 3.9",
20
+ "Programming Language :: Python :: 3.10",
21
+ "Programming Language :: Python :: 3.11",
22
+ "Programming Language :: Python :: 3.12",
23
+ "Programming Language :: Python :: 3.13",
24
+ "Programming Language :: Python :: 3.14",
25
+ "Framework :: Odoo",
26
+ ]
27
+
28
+ requires-python = ">=3.9,<4.0"
29
+ dependencies = [
30
+ "odoo-driver",
31
+ "pyteliummanager",
32
+ ]
33
+
34
+
35
+ [project.urls]
36
+ repository = "https://gitlab.com/grap-rhone-alpes/odoo-driver-plugin-payment-telium"
37
+
38
+ [project.entry-points.'odoo_driver.plugins']
39
+ payment_telium = 'odoo_driver_plugin_payment_telium'
40
+
41
+ [build-system]
42
+ requires = ["poetry-core"]
43
+ build-backend = "poetry.core.masonry.api"
44
+
45
+ [tool.black]
46
+ line-length = 88
47
+
48
+ [tool.isort]
49
+ profile = "black"
50
+ line_length = 88