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)

My self-hosting infrastructure, fully automated from empty disk to operating services

Khue's Homelab Current status: ALPHA This project utilizes Infrastructure as Code to automate provisioning, operating, and updating self-hosted servic

Khue Doan 6.4k Dec 31, 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 02, 2023
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
Example Python code for building RPi-controlled robotic systems

RPi Example Code Example Python code for building RPi-controlled robotic systems These python files have been compiled / developed by the Neurobionics

Elliott Rouse 2 Feb 04, 2022
This application works with serial communication. Use a simple gui to send and receive serial data from arduino and control leds and motor direction

This application works with serial communication. Use a simple gui to send and receive serial data from arduino and control leds and motor direction

ThyagoKZKR 2 Jul 18, 2022
πŸ”† A Python module for controlling power and brightness of the official Raspberry Pi 7

rpi-backlight A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display. Note: This GIF was created using the

Linus Groh 238 Jan 08, 2023
This Home Assistant custom component adding support for controlling Midea dehumidifiers on local network.

This custom component for Home assistant adds support for Midea dehumidifier appliances via the local area network. homeassistant-midea-dehumidifier-l

Nenad Bogojevic 91 Dec 28, 2022
A set of postprocessing scripts and macro to accelerate the gyroid infill print speed with Klipper

A set of postprocessing scripts and macro to accelerate the gyroid infill print speed with Klipper

JΓ©rΓ΄me W. 75 Jan 07, 2023
This is a collection of python modules that interact with the Ryze Tello drone.

This is a collection of python modules that interact with the Ryze Tello drone.

DJI-SDK 1.2k Jan 03, 2023
Count the number of people around you πŸ‘¨β€πŸ‘¨β€πŸ‘¦ by monitoring wifi signals πŸ“‘ .

howmanypeoplearearound Count the number of people around you πŸ‘¨β€πŸ‘¨β€πŸ‘¦ by monitoring wifi signals πŸ“‘ . howmanypeoplearearound calculates the number of

Zack 6.7k Jan 07, 2023
πŸ±πŸ–¨Cat printer is a portable thermal printer sold on AliExpress for around $20.

Cat printer is a portable thermal printer sold on AliExpress for around $20. This repository contains Python code for talking to the cat printer over

671 Jan 05, 2023
Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;)

TMorse Run this code to blink your ThinkPad LED with a hidden mysterious Morse code! ;) Compatible with python3.9+. No third-party library is required

Mahyar 2 Jul 11, 2022
SPI driven CircuitPython driver for PCA9745B constant current LED driver.

Introduction THIS IS VERY MUCH ALPHA AND IN ACTIVE DEVELOPMENT. THINGS WILL BREAK! THIS MAY ALSO BREAK YOUR THINGS! SPI driven CircuitPython driver fo

Andrew Ferguson 1 Jan 14, 2022
A raspberrypi tools for python

raspberrypi-tools how to install: first clone this project: git clone https://github.com/Ardumine/rpi-tools.git then go to the folder cd rpi-tools and

1 Jan 04, 2022
Port of Uxn to digital hardware in the Logisim simulator

Uxn-Logisim Implements the Uxn instruction set in digital hardware. Very WIP. Contents cpu.circ - The Logisim file microcode.mc - Microcode source fil

DeltaF1 11 Mar 27, 2022
A ch341dll Wrap is for using in Python 32bits windows to access I2C SPI and MDIO (by GPIO), and Demo with display PC sreen on OLED by i2c or SPI .

ch341dll_wrap_typcal_app A ch341dll Wrap is for using in Python 32bits windows to access I2C SPI and MDIO (by GPIO). In addition, I provided 3 Demo. I

13 Jan 02, 2023
A flexible data historian based on InfluxDB, Grafana, MQTT and more. Free, open, simple.

Kotori Telemetry data acquisition and sensor networks for humans. Documentation: https://getkotori.org/ Source Code: https://github.com/daq-tools/koto

83 Nov 26, 2022
Implemented robot inverse kinematics.

robot_inverse_kinematics Project setup # put the package in the workspace $ cd ~/catkin_ws/ $ catkin_make $ source devel/setup.bash Description In thi

Jianming Han 2 Dec 08, 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 08, 2022
Brogrammer-keyboard - FIrmware for the Brogrammer Keyboard v1.0

Brogrammer Keyboard Firmware The package contains the firmware that runs on the Brogrammer Keyboard v1.0 See https://imgur.com/a/oY5QZ14 This keyboard

Devin Hartleben 1 Apr 21, 2022