Python library to manipulate Ingenico mobile payment device like iCT220 or iWL220 equipped with Telium Manager. RS232/USB.

Overview

Welcome to Ingenico for Human 👋

One of the few library that help you use this kind of hardware
Download Count /Month License: MIT Code Quality Badge Documentation Status Download Count Total

Python library to manipulate Ingenico mobile payment device equipped with Telium Manager. RS232/USB. Please note that every payment device with Telium Manager should, in theory, work with this.

PyPi

Python 2.7 support has been added to master branch since v2.3.0

pip install pyTeliumManager --upgrade
How to start using pyTeliumManager
# Import telium package
from telium import *

# Open device
my_device = Telium('/dev/ttyACM0')

# Construct our payment infos
my_payment = TeliumAsk.new_payment(
    12.5, 
    payment_mode='debit',  # other mode: credit or refund.
    target_currency='EUR',
    wait_for_transaction_to_end=True,  # If you need valid transaction status
    collect_payment_source_info=True,  # If you need to identify payment source
    force_bank_verification=False
)

# Send payment infos to device
try:
    if not my_device.ask(my_payment):
        print('Your device just refused your transaction. Try again.')
        exit(1)
except TerminalInitializationFailedException as e:
    print(format(e))
    exit(2)

# Wait for terminal to answer
my_answer = my_device.verify(my_payment)

if my_answer is not None:
    # Convert answered data to dict.
    print(my_answer.__dict__)
    
    # > {
    # '_pos_number': '01', 
    # '_payment_mode': '1', 
    # '_currency_numeric': '978', 
    # '_amount': 12.5, 
    # '_private': '0000000000', 
    # 'has_succeeded': True, 
    # 'transaction_id': '0000000000', 
    # '_transaction_result': 0, 
    # '_repport': '4711690463168807000000000000000000000000000000000000000', 
    # '_card_type': 
    #  {
    #      '_name': 'VISA', 
    #      '_regex': '^4[0-9]{12}(?:[0-9]{3})?$', 
    #      '_numbers': '4711690463168807', 
    #      '_masked_numbers': 'XXXXXXXXXXXX8807'
    #  }
    # }

if my_answer.has_succeeded:
    print("Your payment has been processed using a {0} card. Id: {1}".format(my_answer.card_type.name, my_answer.card_type.numbers))
else:
    print("Your payment was rejected. Try again if you wish to.")
How to enable computer liaison with Ingenico device
  1. Press "F" button
  2. Press 0 - Telium Manager
  3. Press 5 - Init
  4. Press 1 - Param
  5. Select - Checkout
  6. Select "Enable"
  7. Choose your preferred interface (USB, COM1, COM2)

Tested devices:

  • Ingenico iWL250
  • Ingenico iCT220
  • Ingenico iCT250

Should work with all i**2XX device equipped with Telium Manager app. Feel free to repport issue if your device isn't compatible with this package.

Won't work

  • All direct PinPad liaison, also known as iPP3XX. (see issue #2)

Q-A

Will this package cause loss of money in any way ?

  • You shouldn't worry about that, I've deployed it for a different store in 2015. No loss has been reported yet.
  • If you hesitate on how to use this package, feel free to ask me before using it.

My device isn't working with this package.

  • Make sure you've followed How to enable computer liaison with Ingenico device steps above beforehand.
  • If you're on Windows, make sure you've installed the correct driver.
  • Try every COM port, one by one.
  • On Linux it should be located at /dev/ttyACM0, if not run ls -l /dev/tty* | grep ACM to locate it.

Contributions

Feel free to propose pull requests. This project may be improved in many ways.

Comments
  • No option to select preferred interface

    No option to select preferred interface

    Thanks for the project I've got an iWL250. I can open Telium Manager, select 3 for initialization, then 1 for parameters, however I can't see "Checkout", only "Cash Connection"

    I can enable this but there is no follow up option to select the preferred interface.

    PC usb A to cradle usb B , PC Ubuntu 18.04 python 2.7

    Any ideas?

    opened by spiderrabbit 12
  • Unable to open ingenico ict220 liason Checkout not found

    Unable to open ingenico ict220 liason Checkout not found

    Hello, I'm trying to enable ingenico liason but the "checkout" is not available under menu you listed in "How to enable computer liaison with Ingenico device". And the connection does not work. Have you a solution?

    opened by c-amara 3
  • Working with devices

    Working with devices

    Greetings, first of all thank you for this library. You have clearly poured a lot of work into this, it looks promising, and there is nothing else like it out there.

    I would like to contribute as I am working on a startup in the retail and fine hardware space.

    I have an IWL250 production device. How can I connect it? Do I first need some kind of root access to the Ingenico machine? Is it possible, in your experience, to get test merchant numbers?

    Apologies of these questions are unreasonable or ill informed, I am just trying to get up and running.

    Many thanks

    Michael

    question 
    opened by michaelmorar 3
  • A non-intrusive way to check everything is OK

    A non-intrusive way to check everything is OK

    Hi. First of all, thank you for your work.

    In the documentation I did not see nothing about checking the terminal status. I would love such a feature. Ideally a Telium.is_ok() returning a boolean wether the terminal is ready or not (something may has happened with the software, the terminal wire may have been disconnected etc.)

    What do you think?

    good first issue 
    opened by azmeuk 3
  • Grammar&english

    Grammar&english

    Hi, I think this should be all the spelling mistakes in your docs fixed :smile:

    I saw your post on SF and thought I'd just quickly jump in. I made a couple of grammar adjustments too, but I saw some other grammar that I thought needs clarification, but can't find it now. I'll have to read through again sometime.

    Hope that helps.

    enhancement 
    opened by JedMeister 3
  • Add support for iPP3XX devices

    Add support for iPP3XX devices

    Support for iPP3XX mobile payment device

    To be clear, all iWL 2XX are currently supported and will still be supported there on next release.

    Next stage for pyTeliumManager is to support next gen mobile payment device. I'm targeting iPP 3XX devices.

    • [x] Buy iPP3XX standalone mobile payment device.
    • [x] Enable USB conn. on device.
    • [x] Search for dev docs or trying reverse engineering.
    • [ ] Adapt TeliumData classes.
    • [ ] Create submodule TCP/IP proxy through usb serial. (AT Command)
    • [ ] Tests
    enhancement help wanted 
    opened by Ousret 3
  • Test Case: test_payment is Failing with: TypeError: a new-style class can't have only classic bases

    Test Case: test_payment is Failing with: TypeError: a new-style class can't have only classic bases

    The test case test_payment.py is failing with the error: TypeError: a new-style class can't have only classic bases

    $ python test_payment.py 
    {
        "_amount": 12.5, 
        "_card_type": null, 
        "_currency_numeric": "978", 
        "_payment_mode": "0", 
        "_pos_number": "01", 
        "_private": "0000000000", 
        "_repport": "0000000000000000000000000000000000000000000000000000000", 
        "_transaction_result": 0, 
        "has_succeeded": true, 
        "transaction_id": "0000000000"
    }
    .E......
    ======================================================================
    ERROR: test_telium_ask_currencies_setter (__main__.TestTPE)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "test_payment.py", line 68, in test_telium_ask_currencies_setter
        my_payment.currency_numeric = 'EUR'
      File "/home/pi/.local/lib/python2.7/site-packages/telium/payment.py", line 97, in currency_numeric
        currency = currencies.get(alpha_3=currency.upper())
      File "/home/pi/.local/lib/python2.7/site-packages/pycountry/db.py", line 40, in load_if_needed
        self._load()
      File "/home/pi/.local/lib/python2.7/site-packages/pycountry/db.py", line 67, in _load
        self.data_class_name, (self.data_class_base,), {})
    TypeError: a new-style class can't have only classic bases
    
    ----------------------------------------------------------------------
    Ran 8 tests in 0.058s
    
    FAILED (errors=1)
    

    Version of the project:

    commit d587d8edd713d929e0323d2a92546b5c60c2d52b (HEAD -> master, origin/master, origin/HEAD)
    Author: TAHRI Ahmed R <[email protected]>
    Date:   Fri Feb 28 22:54:48 2020 +0100
    
        Improve setup.py and expose version in package (#13)
        
        Some python version were missing and the description was not included on PyPi. And fix minors issues.
    
    
    $ python --version
    Python 2.7.16
    
    opened by JeanCarlosChavarriaHughes 2
  • 2.4.0 Release

    2.4.0 Release

    pyTeliumManager 2.4.0

    Changes :

    • Bugfix : Remove Cython from setup.py as it could lead to fatal error.
    • Bugfix : Remove hexdump as a dependency, it could make py2app, py2exe, .. to fail importing it. Replaced.
    • Bugfix : Fix support for Windows as ascii.curses is not easily available on it.
    • Improvement : Add is_ok method to check if your device respond to ENQ (at least).

    Thank you for using this lib. Hope it has served you well. Any PR would be appreciated. There is so much that can be done.

    enhancement 
    opened by Ousret 2
  • Doesn't work for my iCT220

    Doesn't work for my iCT220

    When trying to do the following:

    How to enable computer liaison with Ingenico device Press "F" button Press 0 - Telium Manager Press 5 - Init Press 1 - Param Select - Checkout Select "Enable" Choose your prefered interface (USB, COM1, COM2)

    There is no checkout option. I do have a cash connection option which I enabled. It doesn't give me an option to choose USB though. My M2OS is 47787809. Any suggestions?

    opened by aalejandraa2 2
  • Using test script defaults terminal to MAILORDER SALE

    Using test script defaults terminal to MAILORDER SALE

    Hi,

    I've been trying several different python based telium manager scripts, and they all have the same issue.

    Not sure where else to ask which is why i've raised an issue (sorry!)

    The device shows up under /dev/ttyUSB0 when I use a Serial --> USB A adapter from the 'magic box'.

    I run the test script, and this pops up on the terminal:

    MAILORDER SALE
    Key Card No.
    

    If I continue and put in fake card details and postcode etc, the payment is rejected (expected) and a receipt is printed showing the same value which was sent to it by the test script.

    My question is, why is it going to a mailorder sale, and not displaying the value of the transaction on the terminal itself?

    I would assume it is something to do with config of some sort on the device itself, however I've run over it several times and cannot find anything regarding it.

    opened by PeterAlabaster 2
  • "Payment terminal isn't ready to accept data from host."

    Got this error each time I try to run the example code:

    Payment terminal isn't ready to accept data from host. Check if terminal is properly configured or not busy.

    I checked /dev/ttyACM0. I enabled "Cash connection" on Telium Manager.

    Device: Ingenico iCT250 using standard USB cable.

    opened by jess-sys 2
Releases(2.4.2)
  • 2.4.2(Sep 18, 2021)

  • 2.4.0(Feb 23, 2020)

    ..3 years laters. Enjoy 👍 It is stable enough.

    Changes :

    • Bugfix : Remove Cython from setup.py as it could lead to fatal error.
    • Bugfix : Remove hexdump as a dependency, it could make py2app, py2exe, .. to fail importing it. Replaced.
    • Bugfix : Fix support for Windows as ascii.curses is not easily available on it.
    • Improvement : Add is_ok method to check if your device respond to ENQ (at least).

    Thank you for using this lib. Hope it has served you well. Any PR would be appreciated. There is so much that can be done.

    13k downloads and more to come. 🎉

    Source code(tar.gz)
    Source code(zip)
  • 2.3.0(Sep 29, 2017)

    Changes :

    • Support for native (rs232 <--> rj) serial conn. with device. b6d2b13
    • Enable postpone device open. 383d45f
    • Allow custom wait timeout for transaction result. 0c177bb
    • python 2.7 now supported through master branch. (six package now required) 345b736
    • New property: Get sha512 hashed payment source id. 02342f1
    • Minors improvements.
    Source code(tar.gz)
    Source code(zip)
  • 2.2.2(Aug 5, 2017)

  • 2.2.1(Aug 3, 2017)

  • 2.2.0(Jul 20, 2017)

    Python lib for Ingenico Telium Manager app

    Changes:

    • Can now identify fully qualified numbers and card type. (With Ousret/payment-card-identifier package)
    • TeliumData classes have now improved .dict output. See README.md for sample.
    • Minors improvements.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.0(Jul 10, 2017)

    Python lib for Telium Manager 2.1.0

    Changes:

    • Set long timeout only when we have to wait for transaction ending.
    • Test suites available with simulated device.
    • Minors improvements.
    • Docs improvements.
    Source code(tar.gz)
    Source code(zip)
  • 2.0.2(Jun 16, 2017)

    Python lib for Telium Manager 2.0.2

    Changes:

    • Can now decode raw response when immediate answer from device.
    • Auto create instance of Telium with static method Telium.get(), will find device based on most common path.
    Source code(tar.gz)
    Source code(zip)
  • 2.0.1(Jun 14, 2017)

LUNA: a USB multitool & nMigen library

LUNA is a full toolkit for working with USB using FPGA technology; and provides hardware, gateware, and software to enable USB applications.

Great Scott Gadgets 750 Dec 28, 2022
CircuitPython library for the CH559 USB to Serial chip

CH559 (USB to Serial) CircuitPython Library Why? Because you might want to get keyboard/mouse/gamepad/HID input into your CircuitPython projects witho

Guy Dupont 3 Nov 19, 2022
Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in interesting ways to sense and manipulate the environment.

Mycodo Environmental Regulation System Latest version: 8.12.9 Mycodo is open source software for the Raspberry Pi that couples inputs and outputs in i

Kyle Gabriel 2.3k Dec 29, 2022
Example code to sending USB Gadget multimedia keys via Python

Send Multimedia USB HID Keys via Python As an USB Gadget in Linux This gives a simple script with zero dependencies that can easily run on any Linux d

DevOps Nirvana 2 Jan 2, 2023
A simple portable USB MIDI controller based on Raspberry-PI Pico and a 16-button keypad, written in Circuit Python

RPI-Pico-16-BTn-MIDI-Controller-using-CircuitPython A simple portable USB MIDI controller based on Raspberry-PI Pico, written in Circuit Python. Link

Rounak Dutta 3 Dec 4, 2022
Hotplugger: Real USB Port Passthrough for VFIO/QEMU!

Hotplugger: Real USB Port Passthrough for VFIO/QEMU! Welcome to Hotplugger! This app, as the name might tell you, is a combination of some scripts (py

DARKGuy (Alemar) 66 Nov 24, 2022
LifeSaver automatically, periodically saves USB flash drive data into the PC

LifeSaver automatically, periodically saves USB flash drive data into the PC. Theoriticaly it will work with any any connected drive ex - Hard Disk ,SSD ... But, can't handle Backing up multipatition drives. I can guess, but cannot be sure of, how it will react to multipartiton system.

siddharth dhaka 4 Sep 26, 2021
Monitor Live USB Plug In & Plug Out Events

I/O - Live USB Monitoring Author: Jonathan Scott @jonathandata1 Date: 3/13/2021 CURRENT VERSION 1.0 This is just a simple bash script that calls a pyt

Jonathan Scott 17 Dec 3, 2022
USB Rubber Ducky with the Rasberry Pi pico microcontroller

pico-ducky Install Install and have your USB Rubber Ducky working in less than 5 minutes. Download CircuitPython for the Raspberry Pi Pico. Plug the d

AnOnYmOus001100 3 Oct 8, 2022
Turn your Raspberry Pi Pico into a USB Rubber Ducky

pico-ducky Turn your Raspberry Pi Pico into a USB Rubber Ducky Install Requirements CircuitPython for the Raspberry Pi Pico adafruit-circuitpython-bun

Konstantinos 5 Nov 8, 2022
Unofficial Playdate reverse-engineering notes/tools - covers file formats, server API and USB commands

Unofficial Playdate reverse-engineering notes/tools - covers file formats, server API and USB commands ⚠️ This documentation is unofficial and is not

James 106 Dec 31, 2022
Python library to interact with the GCE Electronics IPX800 device

A python library to control a GCE-Electronics IPX800 V4 device through its API.

Marc-Aurèle Brothier 2 Oct 20, 2021
A Python program that makes it easy to manage modules on a CircuitPython device!

CircuitPython-Bundle-Manager-v2 A Python program that makes it easy to manage modules on a CircuitPython device! The CircuitPython Bundle Manager v2 i

Ckyiu 1 Dec 18, 2021
ROS2 nodes for Waveshare Alphabot2-Pi mobile robot.

ROS2 for Waveshare Alphabot2-Pi This repo contains ROS2 packages for the Waveshare Alphabot2-Pi mobile robot: alphabot2: it contains the nodes used to

Michele Rizzo 2 Oct 11, 2022
Provide Unifi device info via api to Home Assistant that will give ap sensors

Unifi AP Device info Provide Unifi device info via api to Home Assistant that will give ap sensors

null 12 Jan 7, 2023
How to configure IOMMU device for nested Proxmox hypervisor (PVE) VM - PCIe Passthrough

Configuring PCIe Passthrough for Nested Virtualization on Proxmox Summary: If you are running bare-metal L0 (level 0) Proxmox (PVE) hypervisor with ne

Travis Johnson 6 Aug 30, 2022
A DiY holiday project to demonstrate how you can send data from adafruitIO cloud to a balena edge device

holiday-star balena ❤️ adafruitIO Introduction A DiY holiday project to demonstrate how you can send data from adafruitIO cloud to a balena edge devic

Ayan Pahwa 3 Dec 20, 2021
Monitor an EnvisaLink alarm module running Honeywell firmware, and set a Nest device to Home/Away depending on whether the alarm is Disarmed/Away.

Nestalarm Monitor an EnvisaLink alarm module running Honeywell firmware, and set a Nest device to Home/Away depending on whether the alarm is Disarmed

null 1 Dec 30, 2021
This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC

About This tool emulates an EMV-CAP device, to illustrate the article "Banque en ligne : à la decouverte d'EMV-CAP" published in MISC, issue #56 and f

Philippe Teuwen 28 Nov 21, 2022