Issue 11 in iso8583py: iso8583py change bit128

8 views
Skip to first unread message

iso8...@googlecode.com

unread,
Sep 27, 2013, 3:47:57 AM9/27/13
to iso858...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 11 by wangzha...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

Hi:

ASCII to process
<0110F23A40010A80800000000000060000011688888888888888884010000000000001000702014927000006014927070207026011061792000594901241820072172111156168888888888888888191111111111111111111AE3D1B33>

becase bit128=1,so there is error in ISO8583.py
I have changed something in py file, please diff it with vim.



Attachments:
ISO8583.py 57.5 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

iso8...@googlecode.com

unread,
Sep 30, 2013, 9:06:40 AM9/30/13
to iso858...@googlegroups.com
Updates:
Status: Started

Comment #1 on issue 11 by igo...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

Hi,

Like you can see in the code, the 128º bit is "binary", So:

"def __setBitTypeB(self, bit, value):
"""Method that set a bit with value in form B
It complete the size of the bit with a default value
Example: pack.setBit(3,'30000') -> Bit 3 is a B type, so
this bit, in ASCII form need to has size = 6 (ISO especification) so the
value 30000 size = 5 need to receive more "1" number.
In this case, will be "0" in the left. In the
package, the bit will be sent like '030000'
@param: bit -> bit to be setted
@param: value -> value to be setted
@raise: ValueToLarge Exception
It's a internal method, so don't call!
"""
"

So, you cannot have a with "1" and no value, the library wants a binary
with length = 16.

Please give more information about the problem.

iso8...@googlecode.com

unread,
Sep 30, 2013, 9:19:56 PM9/30/13
to iso858...@googlegroups.com

Comment #2 on issue 11 by wangzha...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

Hello:

iso =
"0110F23A40010A80800000000000060000011662260199201777774010000000000001000702014927000006014927070207026011061792000594901241820072172111156166226019920177777191111111111111111111AE3D1B33"

ISO8583.py(source codes), run python test8583.py
Traceback (most recent call last):
File "test8583.py", line 19, in <module>
b.setIsoContent(iso)
File "/home/wangzhaohe/app/ISO8583Module-1.2/ISO8583/ISO8583.py",
line 992, in setIsoContent
self.__inicializeBitsFromBitmapStr(self.BITMAP_HEX)
File "/home/wangzhaohe/app/ISO8583Module-1.2/ISO8583/ISO8583.py",
line 519, in __inicializeBitsFromBitmapStr
self.BITMAP_VALUES[(c +1)* 8] = 'X'
IndexError: list assignment index out of range

*The reason is in line 519:*

def __inicializeBitsFromBitmapStr(self, bitmap):
"""Method that receive a bitmap str, process it, and prepare
ISO8583 object to understand and "see" the bits and values inside the
ISO ASCII package.
It's a internal method, so don't call!
@param: bitmap -> bitmap str to be analized and translated to
"bits"
"""
bits = []
for c in range(0,16):
for d in range(1,9):
if self.DEBUG == True:
print ('Value (%d)-> %s & %s = %s' %
(d,self.BITMAP[c] , self._TMP[d], (self.BITMAP[c] & self._TMP[d]) ))
if (self.BITMAP[c] & self._TMP[d]) == self._TMP[d]:
if d == 1: # e o 8 bit
if self.DEBUG == True:
print ('Bit %s is present !!!' % ((c +1)* 8))
bits.append((c +1)* 8)
*self.BITMAP_VALUES[(c +1)* 8] = 'X'*
else:
if (c == 0) & (d == 2): # Continuation bit

*when c=15, c +1* 8==128, but self.BITMAP_VALUES's lenth is 128**, so
index error displayed.*

#init with "0" the array of values
def __inicializeBitmapValues(self):
"""Method that inicialize/reset a internal array used to save
bits and values
It's a internal method, so don't call!
"""
if self.DEBUG == True:
print ('Init bitmap_values')

if len(self.BITMAP_VALUES) == 128:
*for cont in range(0,128):*
self.BITMAP_VALUES[cont] = self._BIT_DEFAULT_VALUE
else:
*for cont in range(0,128):*
self.BITMAP_VALUES.append(self._BIT_DEFAULT_VALUE)

Here if 128 changes to 129, I think it will be ok.

ISO8583_changed_by_wzh.py, run python test8583.py
['2', 'Primary account number (PAN)', 'LL', 19, 'n']
value = 166226019920177777

['3', 'Precessing code', 'N', 6, 'n']
value = 401000

['4', 'Amount transaction', 'N', 12, 'n']
value = 000000000100

['7', 'Date and time transmission', 'N', 10, 'n']
value = 0702014927

['11', 'Systems trace audit number', 'N', 6, 'n']
value = 000006

['12', 'Date and time local transaction', 'N', 6, 'n']
value = 014927

['13', 'Date effective', 'N', 4, 'n']
value = 0702

['15', 'Date settlement', 'N', 4, 'n']
value = 0702

['18', 'Message error indicator', 'N', 4, 'n']
value = 6011

['32', 'Acquiring institution identification code', 'LL', 11, 'n']
value = 06179200

['37', 'Retrieval reference number', 'N', 12, 'an']
value = 059490124182

['39', 'Action code', 'A', 2, 'an']
value = 00

['41', 'Card acceptor terminal identification', 'N', 8, 'ans']
value = 72172111

['49', 'Verification data', 'A', 3, 'a']
value = 156

['102', 'Account identification 1', 'LL', 28, 'ans']
value = 166226019920177777

['103', 'Account identification 2', 'LL', 28, 'ans']
value = 191111111111111111111

['128', 'Message authentication code (MAC) field', 'B', 16, 'b']
value = AE3D1B33


wangz...@gmail.com
2013-10-01

? 2013?09?30? 21:06, iso8...@googlecode.com ??:

iso8...@googlecode.com

unread,
Oct 1, 2013, 7:03:44 AM10/1/13
to iso858...@googlegroups.com

Comment #3 on issue 11 by igo...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

Yes, this is a bug!
I'll fix it soon!
Thanks

iso8...@googlecode.com

unread,
Oct 7, 2013, 8:32:21 AM10/7/13
to iso858...@googlegroups.com
Updates:
Status: Fixed

Comment #4 on issue 11 by igo...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

Fixed in revision #49.

iso8...@googlecode.com

unread,
Oct 8, 2013, 12:07:09 AM10/8/13
to iso858...@googlegroups.com

Comment #5 on issue 11 by wangzha...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

__version__= '0.3'
not '1.3'

iso8...@googlecode.com

unread,
Oct 8, 2013, 12:08:49 AM10/8/13
to iso858...@googlegroups.com

Comment #6 on issue 11 by wangzha...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

Would you like to change TAB to 4 blanks?

iso8...@googlecode.com

unread,
Oct 8, 2013, 12:54:07 AM10/8/13
to iso858...@googlegroups.com

Comment #7 on issue 11 by wangzha...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

Why did not change 128 to 129 in line 351, 794, 911, 1064. If not change
these, bit128 will not be displayed.

The forms <> and != are equivalent; for consistency with C, != is
preferred; where != is mentioned below <> is also accepted. The <> spelling
is considered obsolescent.

Why changed print() to print, python3 will not support print.

iso8...@googlecode.com

unread,
Oct 8, 2013, 7:55:37 AM10/8/13
to iso858...@googlegroups.com

Comment #8 on issue 11 by igo...@gmail.com: iso8583py change bit128
http://code.google.com/p/iso8583py/issues/detail?id=11

Hi,

I fixed issues that you said in #7: "change 128 to 129 in line 351, 794,
911, 1064." Thanks.

I look for print's and change that ones without "()". Thanks.

So I released a revision #51

I'll Think about change tab for 4 blanks ...

Best regards,
Reply all
Reply to author
Forward
0 new messages