我修改了提供的示例here,但它不适用于托管应用。 显然问题是连接票,不应该从我的理解中使用。
以下是java类:
public class MyPayment {
public static void main(String[] args) throws Exception{
QbmsConfiguration qbmsConfiguration =new QbmsConfiguration("/qbmsconnector.properties");
// Create a JAXB-backed QbmsConnector
QbmsConnector qbmsConnector =new JaxbQbmsConnector(qbmsConfiguration);
// Build a charge request...
CreditCardChargeRequest request =new CreditCardChargeRequest();
request.setCreditCardNumber("4111111111111111");
request.setNameOnCard("John Doe");
request.setExpirationMonth(12);
request.setExpirationYear(2014);
request.setAmount(130.00);
// ...define a connection ticket...
String connectionTicket ="TGT-XXX-XXXXXXXXXXXXXXXXXXXXXX";
// ...and make the payment.
try{
CreditCardChargeResponse response = qbmsConnector.creditCardCharge(connectionTicket, request);
System.out.println(response);
}catch(QbmsOperationException e){
System.out.println("Payment failed: "+ e.getMessage());
e.printStackTrace();
}
}
}
这是qbmsconnector.properties
qbmsconnector.applicationLogin=loginidxxxxxx
qbmsconnector.applicationId=123456789
qbmsconnector.environment=ptc
qbmsconnector.model=hosted
qbmsconnector.keyStoreLocation=/qbms
qbmsconnector.keyStorePassword=password111
qbmsconnector.certPassword=password111
qbmsconnector.certAlias=alias_abc
它会引发以下错误:
Payment failed: Application agent not found TGT-XXX-XXXXXXXXXXXXXXXXXXXXXX
com.intuit.qbmsconnector.response.QbmsResponseStatusException: Application agent not found TGT-XXX-XXXXXXXXXXXXXXXXXXXXXX
at com.intuit.qbmsconnector.jaxb.JaxbResponseExtractor.processSignonNode(Unknown Source)
at com.intuit.qbmsconnector.jaxb.JaxbResponseExtractor.unmarshal(Unknown Source)
at com.intuit.qbmsconnector.jaxb.JaxbResponseExtractor.extractCreditCardChargeResponse(Unknown Source)
at com.intuit.qbmsconnector.jaxb.JaxbQbmsConnector.creditCardCharge(Unknown Source)
at qbo.MyPayment.main(MyPayment.java:30)
答案 0 :(得分:0)
此错误:
Application agent not found TGT-XXX-XXXXXXXXXXXXXXXXXXXXXX
通常表示1或2件事:
OR