Issue 5 in iso8583py: Binary data on field 52

26 views
Skip to first unread message

iso8...@googlecode.com

unread,
Feb 23, 2010, 2:36:20 PM2/23/10
to iso858...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 5 by caente: Binary data on field 52
http://code.google.com/p/iso8583py/issues/detail?id=5

Hello, this is not an actual issue, I'm sorry, but didn't find another
place to ask:

I'm planning to use iso8583py in a django project as a middleware between
the mobile clients(who send http requests) and a JPOS who make the actual
connections with the Switch.

For that I need to send to the JPOS server a message with a binary field
52, where the 6 digits NIP goes, for that I do something like:
msg.setBit(52,123456)
msg.redefineBit(52, '52', msg.getLargeBitName(52), 'B', 6,"n" )

So far so good, in the JPOS server I got:

<field id="52" value="0000000000123456" type="binary"/>

The problem is: that value is not the binary representation of the NIP, in
java I would do:

msg.set(52, "123456".getBytes());

I have searched the web but I haven't found anything like that for python,
what do you use?

Ah, BTW, I wrote something like the ISOMUX of JPOS, I made it based on
Queue.Queue() and it have a really nice performance, when I test it a bit
more I will send it to you, in case it helps.

good luck

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

iso8...@googlecode.com

unread,
Feb 23, 2010, 3:52:45 PM2/23/10
to iso858...@googlegroups.com

Comment #1 on issue 5 by caente: Binary data on field 52
http://code.google.com/p/iso8583py/issues/detail?id=5

I found the solution:
import binascii
bin_nip = binascii.b2a_hex(nip)

iso8...@googlecode.com

unread,
Feb 23, 2010, 4:04:51 PM2/23/10
to iso858...@googlegroups.com

Comment #2 on issue 5 by caente: Binary data on field 52
http://code.google.com/p/iso8583py/issues/detail?id=5

So I recommend like this in redefineBit():

if bitType == "B":
self.setBit(bit,binascii.b2a_hex(self.getBit(bit)))

I guess that "B" means binary

iso8...@googlecode.com

unread,
Feb 23, 2010, 6:00:22 PM2/23/10
to iso858...@googlegroups.com

Comment #3 on issue 5 by caente: Binary data on field 52
http://code.google.com/p/iso8583py/issues/detail?id=5

And of course, here:
def __setBitTypeB(self, bit, value):
value = "%s" % binascii.b2a_hex(value)

iso8...@googlecode.com

unread,
May 11, 2010, 1:18:41 PM5/11/10
to iso858...@googlegroups.com
Updates:
Status: Invalid
Labels: -Type-Defect -Priority-Medium Type-Other Priority-Low
Maintainability

Comment #4 on issue 5 by igorvc: Binary data on field 52
http://code.google.com/p/iso8583py/issues/detail?id=5

Hi,
This happened because ISO8583py work with ASCII data, not Binary.
We'll improve the library and deal with Binary Data, like you can see in
TODO file.
Thanks,

--
Você está recebendo esta mensagem porque se inscreveu no grupo "iso8583python" dos Grupos do Google.
Para postar neste grupo, envie um e-mail para iso858...@googlegroups.com.
Para cancelar a inscrição nesse grupo, envie um e-mail para iso8583pytho...@googlegroups.com.
Para obter mais opções, visite esse grupo em http://groups.google.com/group/iso8583python?hl=pt-BR.

Reply all
Reply to author
Forward
0 new messages