Ousret / pyTeliumManager

Python library to manipulate Ingenico mobile payment device like iCT220 or iWL220 equipped with Telium Manager. RS232/USB.
http://pyteliummanager.readthedocs.io
MIT License
104 stars 20 forks source link

Check payment with i2200 #7

Closed maitredede closed 6 years ago

maitredede commented 6 years ago

Hi, I am testing a iCT220 with a i2200 check printer plugged. Do you have a sample of a working check printing case ? Thanks.

Ousret commented 6 years ago

Hi,

I've never had the chance to test a i2200 check printer for the moment, I don't know if I should add some code to make it work, normally I think not.

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

# Construct our payment infos
my_payment = TeliumAsk(
    '1',  # Checkout ID 1
    TERMINAL_ANSWER_SET_SMALLSIZED,  # Ask for small sized report
    TERMINAL_MODE_PAYMENT_AUTO,  # Let AUTO mode for check
    TERMINAL_TYPE_PAYMENT_CHECK,  # Using check
    TERMINAL_NUMERIC_CURRENCY_USD,  # Set currency to USD
    TERMINAL_REQUEST_ANSWER_INSTANT,  # Don't wait for answer, it's a check.
    TERMINAL_FORCE_AUTHORIZATION_DISABLE,  # Let device choose if we should ask for authorization
    12.5  # Ask for 12.5 USD
)

# Send payment infos to device
my_device.ask(my_payment)

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

if my_answer is not None:
    # Print answered data from terminal
    print(my_answer.__dict__)

Try it out and let's see.