我正在使用名为AuthSample
chase-paymentech
的{{1}} Java SDK
开发'PaymentechSDK.jar'
示例。当我尝试执行示例代码时,我遇到了以下错误。我不明白这个问题是什么。任何人都可以指导我吗?
仅供参考 - https://docs.oracle.com/cd/E69185_01/cwdirect/pdf/180/cwdirect_user_reference/SO04_16.htm
version 7.4.0
以下代码供参考:
org.eclipse.debug.core.DebugException: com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred while retrieving component type of array
TransactionProcessor failed to initialize
null
com.paymentech.orbital.sdk.util.exceptions.InitializationException
at com.paymentech.orbital.sdk.configurator.Configurator.loadSecurityProviders(Configurator.java:349)
at com.paymentech.orbital.sdk.configurator.Configurator.load(Configurator.java:393)
at com.paymentech.orbital.sdk.configurator.Configurator.getInstance(Configurator.java:72)
at com.paymentech.orbital.sdk.transactionProcessor.TransactionProcessor.<init>(TransactionProcessor.java:43)
at com.chase.paymentech.AuthSample.main(AuthSample.java:20)
的log4j-config.xml中
public class AuthSample {
//Global Constants
public final static int NORMAL_EXIT = 1;
public final static int ERROR_EXIT = -1;
public static void main(String[] args) {
TransactionProcessorIF tp = null;
try {
tp = new TransactionProcessor();
} catch (InitializationException iex) {
System.err.println("TransactionProcessor failed to initialize");
System.err.println(iex.getMessage());
iex.printStackTrace();
System.exit(ERROR_EXIT);
}
RequestIF request = null;
try {
//Tell the request object which template to use (see RequestIF.java)
request = new Request(RequestIF.NEW_ORDER_TRANSACTION);
//Basic Auth Fields
request.setFieldValue("IndustryType", "EC");
request.setFieldValue("MessageType", "A");
request.setFieldValue("MerchantID", "700000000413");
request.setFieldValue("BIN", "000002");
request.setFieldValue("OrderID", "122003SA");
request.setFieldValue("AccountNum", "4055011111111111");
request.setFieldValue("Amount", "100");
request.setFieldValue("Exp", "1209");
// AVS Information
request.setFieldValue("AVSname", "Jon Smith");
request.setFieldValue("AVSaddress1", "4200 W Cypress St");
request.setFieldValue("AVScity", "Tampa");
request.setFieldValue("AVSstate", "FL");
request.setFieldValue("AVSzip", "11111");
// Additional Information
request.setFieldValue("Comments", "This is Java SDK");
request.setFieldValue("ShippingRef", "FEDEX WB12345678 Pri 1");
//Uncomment the line below and modify to add a card security value (CVV2, CVC2 or CID)
request.setFieldValue("CardSecVal", "111");
request.setFieldValue("CardSecValInd", "1");
//Display the request
System.out.println("\nAuth Request:\n" + request.getXML());
} catch (InitializationException ie) {
System.err.println("Unable to initialize request object");
System.err.println(ie.getMessage());
ie.printStackTrace();
System.exit(ERROR_EXIT);
} catch (FieldNotFoundException fnfe) {
System.err.println("Unable to find XML field in template");
System.err.println(fnfe.getMessage());
fnfe.printStackTrace();
System.exit(ERROR_EXIT);
} catch (Exception e) {
e.printStackTrace();
System.exit(ERROR_EXIT);
}
//Process the transaction
ResponseIF response = null;
try {
response = tp.process(request);
} catch (TransactionException tex) {
System.err.println("Transaction failed, including retries and failover");
System.err.println(tex.getMessage());
tex.printStackTrace();
System.exit(ERROR_EXIT);
}
//Display the response
//This line displays the entire xml response on the java system console.
System.out.println("--------------------------------------------------");
System.out.println("\nResponse:\n" + response.toXmlString() + "\n");
System.out.println("Response Attributes:");
System.out.println("isGood=" + response.isGood());
System.out.println("isError=" + response.isError());
System.out.println("isQuickResponse=" + response.isQuickResponse());
System.out.println("isApproved=" + response.isApproved());
System.out.println("isDeclined=" + response.isDeclined());
System.out.println("AuthCode=" + response.getAuthCode());
System.out.println("TxRefNum=" + response.getTxRefNum());
System.out.println("ResponseCode=" + response.getResponseCode());
System.out.println("Status=" + response.getStatus());
System.out.println("Message=" + response.getMessage());
System.out.println("AVSCode=" + response.getAVSResponseCode());
System.out.println("CVV2ResponseCode=" + response.getCVV2RespCode());
System.out.println("--------------------------------------------------");
}
}
linehandler.properties
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration>
<appender name="eCommerce" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${PAYMENTECH_LOGDIR}/eCommerce.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%5p,%d,[%c] - %m%n"/>
</layout>
</appender>
<appender name="engine" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="${PAYMENTECH_LOGDIR}/engine.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%5p,%d,[%c] - %m%n"/>
</layout>
</appender>
<category name="eCommerceLogger" additivity="false">
<priority value="INFO" />
<appender-ref ref="eCommerce"/>
</category>
<category name="engineLogger" additivity="false">
<priority value="INFO" />
<appender-ref ref="engine"/>
</category>
<category additivity="false" name="org.apache.commons.httpclient">
<appender-ref ref="engine"/>
</category>
<category additivity="false" name="com.paymentech.orbital.sdk.util.ssl.StrictSSLProtocolSocketFactory">
<appender-ref ref="engine"/>
</category>
<category additivity="false" name="httpclient">
<appender-ref ref="engine"/>
</category>
</log4j:configuration>
我认为这些信息足以理解这个问题。请帮忙。
答案 0 :(得分:0)
好像您正在尝试从NULL中检索值
RequestIF request = null;
request =新请求(RequestIF.NEW_ORDER_TRANSACTION);
请检查并使用适当的对象进行更新。