gpt4 book ai didi

java - JPos - ISO8583 消息 TLV 字段

转载 作者:行者123 更新时间:2023-11-30 06:24:04 26 4
gpt4 key购买 nike

我正在使用 jpos 库构建一个简单的电子购买金融消息,我正在使用通用打包器来打包我的消息字段,问题出现在字段 48(TLV 字段)处。

这里是字段 48 的打包参数。

        <isofieldpackager id="48"
name="Additional Private Data"
length="999"
class="org.jpos.iso.IFB_LLLBINARY"
emitBitmap="false"
tagMapper="org.jpos.iso.packager.TTTDecimalTagMapper"
packager="org.jpos.iso.packager.GenericTaggedFieldsPackager">

<!-- -->
<isofield id="1" length="8" name="PSP Identifier" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2"/>

<!-- -->
<isofield id="2" length="8" name="Ecommerce Acquirer Identifier" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2"/>

<!-- -->
<isofield id="3" length="3" name="Buyer Country Code" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2" />

<!-- -->
<isofield id="4" length="20" name="Buyer Card Brand" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2" />

<!-- -->
<isofield id="5" length="24" name="Buyer IP Address" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2" />

<!-- -->
<isofield id="6" length="30" name="Buyer email Address" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2" />

<!-- -->
<isofield id="7" length="14" name="Buyer Phone Number" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2" />

<isofield id="8" length="6" name="Merchant Operation Reference" class="org.jpos.iso.IF_CHAR" />
<isofield id="9" length="3" name="One Click Indicator" class="org.jpos.iso.IF_CHAR"/>
<isofield id="10" length="12" name="ISC INTERNET PIN" class="org.jpos.iso.IF_CHAR"/>
<isofield id="11" length="3" name="One Click Indicator" class="org.jpos.iso.IF_CHAR"/>
<isofield id="12" length="12" name="ISC INTERNET PIN" class="org.jpos.iso.IF_CHAR"/>

<!-- -->
<isofield id="13" length="12" name="One Click Indicator" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2"/>

<!-- -->
<isofield id="14" length="1" name="ISC INTERNET PIN" class="ma.XXY.net.merkit.utils.IFA_TTLLBINARY2"/>

</isofieldpackager>

IFA_TTLLBINARY2.java

        public class IFA_TTLLBINARY2 extends ISOTagBinaryFieldPackager {

public IFA_TTLLBINARY2() {
super(0,null, BcdPrefixer.LLL, NullPadder.INSTANCE,
LiteralBinaryInterpreter.INSTANCE, BcdPrefixer.LL);
}

public IFA_TTLLBINARY2 (int len, String description) {
super(len, description, BcdPrefixer.LLL, NullPadder.INSTANCE,
LiteralBinaryInterpreter.INSTANCE, BcdPrefixer.LL);
}
}

ma​​in.java

    ISOMsg authISOMsg = new ISOMsg();
ISOMsg authISOMsgResp;
QMUX qMux;
IServicesUtils service = new ServiceUtilsImpl();

logger.info("Initiating Authorization Request for Simple ePurchase Transaction : 11001122222");

// To be used in header
String stan = service.generateSTAN();

// HEADER
String acquirerTimeOut = service
.getValuesFromPropertiesFile(new String[] { IConstants.ACQUIRER_MSG_TIMEOUT }, "parameters.properties")
.get(IConstants.ACQUIRER_MSG_TIMEOUT).toString();

String issuerTimeOut = service
.getValuesFromPropertiesFile(new String[] { IConstants.ISSUER_MSG_TIMEOUT }, "parameters.properties")
.get(IConstants.ISSUER_MSG_TIMEOUT).toString();

authISOMsg.setHeader(("001" + issuerTimeOut + DateUtils.getHeaderFieldIso(new Date(), stan)).getBytes());

try {
// MTI
authISOMsg.setMTI(IsoConstants.ISO_AUTH_REQUEST_MSG_MTI);

authISOMsg.set(14, "0819");

// Merchant Type - not existing in mpi response
authISOMsg.set(18, "3306");

// POS Entry Mode
authISOMsg.set(22, IsoConstants.ISO_AUTH_REQUEST_POS_ENTRY_MODE);

// POS Condition code
authISOMsg.set(25,IsoConstants.ISO_AUTH_REQUEST_POS_CONDITION_CODE);

// Card Acceptor Terminal Identification
authISOMsg.set(41,"BX023350");

// Merchant ID
authISOMsg.set(42, service.reduceMerchantIDLength("*****"));

//
authISOMsg.set("48.1","PSP_001");
authISOMsg.set("48.2","ACQ_002");
authISOMsg.set("48.3","MAR");
authISOMsg.set("48.4","VISA INTERNATIONAL");
authISOMsg.set("48.5","10.0.0.136");
authISOMsg.set("48.6","*****");
authISOMsg.set("48.7","******");

// Currency
authISOMsg.set(49,"840");

Q2 scanner = new Q2();
scanner.start();

qMux = (QMUX) QMUX.getMUX("clientmux");

authISOMsgResp = qMux.request(authISOMsg,
Integer.parseInt(acquirerTimeOut));
if (authISOMsgResp != null) {
System.out.println(authISOMsgResp.getString(2));
}

上面的主要代码表示包含一些字段的财务消息,我遇到的问题发生在字段 48

下面的错误引发以下异常。

    Nested:org.jpos.iso.ISOException: Error reading deploy\packager\basic-packager.xml (org.xml.sax.SAXParseException; systemId: file:basic-packager.xml; 
lineNumber: 114; columnNumber: 64; Attribute "tagMapper" must be declared for element type "isofieldpackager").

最佳答案

看来您需要使用generic-subtag-packager.dtd验证您的 xml 打包器定义。

您可以将该文件复制到 xml 所在的目录中,并用 doctype 定义替换该文件:

<!DOCTYPE isopackager SYSTEM "generic-subtag-packager.dtd">

我希望这能解决您的问题。

关于java - JPos - ISO8583 消息 TLV 字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47576377/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com