UPI CUP integration issue. not able to test with simulator wrong message format

369 views
Skip to first unread message

Azad Mohammad

unread,
Aug 19, 2015, 12:42:19 AM8/19/15
to jPOS Users
Hello,

i am integrating with CUP UPI using JPOS  and used

1. Writtne code NACChannel and customized packager using ISO87BPackager.
2. used TPDU to send 10 + 12 byte header .
3. using CUP simulator to test.
simulator showing bad message format. i dont have any guide to use and setup cup simulaotor.
is anyone help to with cup simulator or any other simulator that can use for CUP test.

thanks
Azad

Victor Salaman

unread,
Aug 19, 2015, 12:46:04 AM8/19/15
to jpos-...@googlegroups.com
Hi: 

First, what is CUP. Are we assumed to be CUP experts? :)

TPDU in a NACChannel message is only 5 bytes, so where are coming up with 10 + 12 byte header?

/V



--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/67fcd030-dfe9-45d5-a0e4-cc00fed16ca7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Azad Mohammad

unread,
Aug 19, 2015, 1:44:55 AM8/19/15
to jPOS Users
Hi Victor,

CUP - is china union pay. if i can send only 5 byte TPDU (BCD) then how i can send additional 6 bytes header (channel customization?).

Victor Salaman

unread,
Aug 19, 2015, 2:05:50 AM8/19/15
to jpos-...@googlegroups.com
You'll need to use a channel that matches your communications specification. A NACChannel normally handles a 5 byte TPDU header... Check your documentation and either find a channel that matches, extend one of the existing ones or create a new one.

Good luck,

/V

Azad Mohammad

unread,
Aug 19, 2015, 3:05:08 AM8/19/15
to jPOS Users
Thanks Victor,

Now i understood how it works. 5 bytes TPDU header taken care by NAChannel and for additional header i added below code with every message. I am still struggling for CHINA UNION pay simulator. not any help from other side to test my code or query.

Specs:
5 byte TPDU + 6 Message header + ISO message

CODE:
ISOMsg msg =new ISOMsg();

msg.setHeader(ISOUtil.hex2byte("603010000000"));


LOGS:

<isomsg>

<header>603010000000</header>

<field id="0" value="0200"/>

<field id="2" value="6212264000001899463"/>

<field id="3" value="000000"/>

<field id="4" value="000000000100"/>

<field id="11" value="033460"/>

<field id="14" value="2106"/>

<field id="22" value="051"/>

<field id="23" value="001"/>

<field id="25" value="00"/>

<field id="26" value="12"/>

<field id="35" value="6212264000001899463DFF9354AB57C514029"/>

<field id="41" value="16021500"/>

<field id="42" value="000012709701103"/>

<field id="49" value="840"/>

<field id="52" value="019C2794A09CB6C3" type="binary"/>

<field id="53" value="2610000000000000"/>

<field id="55" value="9F26087D7013C90F9B688B9F2701809F101307010103A0A802010A01000000361907167E7E9F37049F0E155D9F36020795950500800400009A031310259C01009F02060000000000095F2A02015682027C009F1A0201569F03060000000000009F3303E0E1C89F34030203009F3501229F1E083132333435363738" type="binary"/>

<field id="60" value="22000128000501"/>

<field id="64" value="3037343146304245" type="binary"/>

</isomsg>


Thanks
Azad

Mark Salter

unread,
Aug 19, 2015, 1:18:47 PM8/19/15
to jPOS Users


On Wednesday, August 19, 2015 at 8:05:08 AM UTC+1, Azad Mohammad wrote:
I am still struggling for CHINA UNION pay simulator. not any help from other side to test my code or query.

The Channel is also responsible for specifying the length of the packet, so the Channel you use will need (as Victor said) to fully match all expectations of the target system/simulator.

Check the spec and make sure the length is correct value and format - if the simulator is simply saying  "bad message format" and nothing else at all, then I would think it does not like the length you are giving it and is just stopping?

I have a very rough recollection that CUP might use little endian for message length?

--
Mark
license, license, license :-)

Alejandro Revilla

unread,
Aug 19, 2015, 1:27:33 PM8/19/15
to jPOS Users

​I believe length is similar to ASCIIChannel, problem is they have a dynamic header that also needs to include the length.

From our implementation notes:

 * <pre>
 *  1: Header Length           1 (Pos: 0)
 *  2: Flag and Version        1 (Pos: 1)
 *  3: Total Message Length    4 (Pos: 2-5)
 *  4: Destination ID         11 (Pos: 6-16)
 *  5: Source ID              11 (Pos: 17-27)
 *  6: Reserved                3 (Pos: 28-30)
 *  7: Batch Number            1 (Pos: 31)
 *  8: Transaction Information 8 (Pos: 32-39)
 *  9: User Information        1 (Pos: 40)
 * 10: Reject Code             5 (Pos: 41,45)
 * </pre>

​wasn't easy to nail down.



--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.

chhil

unread,
Aug 19, 2015, 1:49:09 PM8/19/15
to jpos-...@googlegroups.com

Azad Mohammad

unread,
Aug 24, 2015, 5:34:59 AM8/24/15
to jPOS Users
hello chill,

I tried to build custome header and my request look like below but cup simulator saying head parsing error although online https://iso8583.info/lib/CUP/Online/msg parsing correct. please help . any suggestion,


303830300038000000C000123331323730303135303132373038323431363032313530303030303031323730393730313130333031313030313233343536303031303033435550

main() Byte Hex dump:::: =

0000 30 38 30 30 00 38 00 00 00 C0 00 12 33 31 32 37 0800.8......3127

0010 30 30 31 35 30 31 32 37 30 38 32 34 31 36 30 32 0015012708241602

0020 31 35 30 30 30 30 30 30 31 32 37 30 39 37 30 31 1500000012709701

0030 31 30 33 30 31 31 30 30 31 32 33 34 35 36 30 30 1030110012345600

0040 31 30 30 33 43 55 50 1003CUP

<isomsg>

<header>2E523031383830303030303030312020203130333434303030202020000000053130303030303030003030303030</header>

<field id="0" value="0800"/>

<field id="11" value="312700"/>

<field id="12" value="150127"/>

<field id="13" value="0824"/>

<field id="41" value="16021500"/>

<field id="42" value="000012709701103"/>

<field id="60" value="00123456001"/>

<field id="63" value="CUP"/>

</isomsg>

chhil

unread,
Aug 24, 2015, 8:33:35 AM8/24/15
to jpos-...@googlegroups.com
I dont have a CUP spec and the one online that you point to doesn't tell you how the individual fields are packaged. I would not call that a message specification.

There is really no way to move forward unless you can get hold of a real specification or have someone at CUP tell you what is wrong with your message or provide you with a low level tcp dump of a good message so that you could attempt to reverse engineer it. 

There were other individuals in the group who have queried about field 48 formats for CUP, may be they can assist you with the header.

-chhil

MSI

unread,
Jun 20, 2019, 11:56:45 AM6/20/19
to jPOS Users
@Azad - did you ever resolve this?
Reply all
Reply to author
Forward
0 new messages