简体   繁体   English

如何通过QBMS Java API在托管模式下处理信用卡

[英]How to process credit card in hosted mode via QBMS Java API

I modified the sample provided here , but it doesn't work for the hosted app. 我修改了此处提供的示例,但不适用于托管应用。 Clearly the problem is the connection ticket, which should not be used from my understanding. 显然问题是连接票证,据我了解,不应使用该票证。

The following is the java class: 以下是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();
        }
    }
}

Here is the qbmsconnector.properties 这是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

It throws the following errors: 它引发以下错误:

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)

This error: 这个错误:

Application agent not found TGT-XXX-XXXXXXXXXXXXXXXXXXXXXX

Generally indicates 1 or 2 things: 通常表示1或2件事:

  • You're not using a valid connection ticket (is that the actual connection ticket you're using, or did you XXX out the connection ticket?) 您未使用有效的连接凭单(是您使用的实际连接凭单,还是您对连接凭单进行了XXX?)

OR 要么

  • You're using a valid connection ticket, but you're using it with the wrong environment. 您使用的是有效的连接票证,但您在错误的环境中使用它。 Connection tickets generated in the PTC environment do not work with the production environment, and vice versa. 在PTC环境中生成的连接票证不适用于生产环境,反之亦然。 Did you generate the connection ticket for PTC, or for production? 您是否为PTC或生产生成了连接票证?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 销售收据流程信用卡付款QBO V2 - Sales Receipt Process Credit Card Payment QBO V2 通过Merchant Services确认测试信用卡交易 - Confirming Test Credit Card Transactions via Merchant Servicess IntuIt QuickBooks付款API,如何使用IppDotNetSdkForQuickBooksApiV3软件包的servicecontext执行信用卡交易? - IntuIt QuickBooks payments API, How can I perform credit card transactions using servicecontext of IppDotNetSdkForQuickBooksApiV3 package? 帐户汇总器/ API-提供信用卡账单到期日并允许跨方付款的帐户汇总器/ API? - Account Aggregators/API's - which provide credit card bill due-dates and allow for cross-party payments? 将站点迁移到新服务器,我是否需要新的连接票证和Intuit QBMS证书? - Migrating site to a new server, do I need a new connection ticket and certificates for Intuit QBMS? 如何在Quickbooks的托管付款页中包含订单信息? - How to include order information in Quickbooks' Hosted Paypage? 通过Quickbooks API检索员工的电子邮件地址 - Retrieving employee email addresses via Quickbooks API 通过QuickBooks API获取项目总数 - Get total number of items via QuickBooks API 是否可以通过Quickbooks Online API获得定期发票和其他项目 - Are recurring invoices and other items available via the Quickbooks Online API 对于任何在线用户,如何将Quickbooks在线基本帐户连接到我们的Web托管网站? - How Connect Quickbooks online essential account to our web hosted website for any online users?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM