Git Product home page Git Product logo

py8583's Issues

ValueError: Unknown format code 'd' for object of type 'str'

Hello again, and sorry!

Im getting this error, i dont know if i am sending the data in wrong format ot its any else:

Thanks for help!

Traceback (most recent call last):
File "request2.py", line 49, in
Socket.send(req.BuildIso())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-p
ackages\py8583\py8583.py", line 391, in BuildIso
self.BuildField(field)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python36\lib\site-p
ackages\py8583\py8583.py", line 341, in BuildField
data = formatter.format(self.__FieldData[field])
ValueError: Unknown format code 'd' for object of type 'str'

`from config import *
import socket
from py8583 import *

#try:
req = py8583.Iso8583(IsoSpec = py8583spec.IsoSpec1987ASCII())

req.MTI('0200')

req.Field(2, 1)
req.FieldData(2, '5896580743857002')

req.Field(3, 1)
req.FieldData(3, '000000')

req.Field(4, 1)
req.FieldData(4, '000000000000')

req.Field(7, 1)
req.FieldData(7, '0612151557')

req.Field(11, 1)
req.FieldData(11, '000001')

req.Field(12, 1)
req.FieldData(12, '190612')

req.Field(18, 1)
req.FieldData(18, '6011')

req.Field(22, 1)
req.FieldData(22, '010')

req.Field(41, 1)
req.FieldData(41, '007899')

req.Field(42, 1)
req.FieldData(42, 'TYME')

req.Field(49, 1)
req.FieldData(49, '840')

req.PrintMessage()

Socket = socket.socket()
Socket.settimeout(socket_timeout)
Socket.connect((socket_address, socket_port))
Socket.send(req.BuildIso())

data = Socket.recv(socket_recv_size)

resp = py8583.Iso8583(data, IsoSpec = py8583spec.IsoSpec1987ASCII()) # Parse message

resp.DebugMessage()`

%s Value length larger than field maximum (6)

Hello, what is wrong in my code? I need send this card data! Thanks!

`from config import *
import socket
from py8583 import *

try:
req = py8583.Iso8583(IsoSpec = py8583spec.IsoSpec1987ASCII())

req.MTI('0200') # Set message MTI

req.Field(2, 1) 
req.FieldData(2, '5896580743857002') 

req.Field(3, 1) 
req.FieldData(3, '000000')

req.Field(4, 1) 
req.FieldData(4, '000000000000')

req.Field(7, 1) 
req.FieldData(7, '0612151557')

req.Field(11, 1) 
req.FieldData(11, '000001')

req.Field(12, 1) 
req.FieldData(12, '190612071557')

req.Field(18, 1) 
req.FieldData(18, '6011')

req.Field(22, 1) 
req.FieldData(22, '010011012110')

req.Field(41, 1) 
req.FieldData(41, '007899')

req.Field(42, 1) 
req.FieldData(42, 'TYME')

req.Field(49, 1) 
req.FieldData(49, '840')


req.PrintMessage()

# Send message - replace with your own send

Socket = socket.socket()
Socket.settimeout(socket_timeout)
Socket.connect((socket_address, socket_port))
Socket.send(req.BuildIso())

# Receive reply - replace with your own receive
data = Socket.recv(socket_recv_size)

resp = py8583.Iso8583(data, IsoSpec = py8583spec.IsoSpec1987ASCII()) # Parse message

resp.DebugMessage()

except socket.timeout:
print("\33[41m La respuesta del host ha excedido el tiempo maximo")
except Exception as e:
print("\33[41m Ha ocurrido un error: %s", e)`

Error Parsing MTI response

After receiving response from the socket, it fails to parse the message received.
py8583.py8583.parseerror: 'invalid mti: [\x01$02]'

enum34 incompatible with Python 3.6 +

Hi!

Trying to install py8583 on Python 3.7 causes problems because enum34 clashes with the enum included in the standard library. It shouldn't really be required for python > 3.4.

Fix for a similar issue was this in the setup.py:

if sys.version_info < (3, 4):
    REQUIRES.append('enum34')

Could you add something similar to resolve this?

Message Header Not Included

hi, thanks for the implementation for ISO8583 with Python. In the sample, seesm nowhere to format the message header.

any sample on IsoClient?

Usage:

Do we have any documentation for this repo?

i am unable to build a message for transmitting over network

Error when import py8583spec

I got this error when import py8583spec from py8583 import py8583spec

    from py8583.py8583 import DT, LT, SpecError
ImportError: No module named py8583

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.