QuickBooks Online API - Add Connect Button

910 Views Asked by At

I'm using JSF and When adding connect button to my index.html in Google Chrome as follows;

<html xmlns="http://www.w3.org/1999/xhtml"  
 xmlns:ipp=""   
 xmlns:ui="http://java.sun.com/jsf/facelets"    
 xmlns:h="http://java.sun.com/jsf/html"     
 xmlns:f="http://java.sun.com/jsf/core"     
 xmlns:p="http://primefaces.org/ui">

 <f:view>   
 <h:head>       
 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>      
 <script type="text/javascript"
   src="https://appcenter.intuit.com/Content/IA/intuit.ipp.anywhere.js">


    intuit.ipp.anywhere.setup({
        menuProxy: 'http://com.example/dispatch/BlueDotMenu',
        grantUrl: 'http://com.example/dispatch/RequestOAuthToken'       }); 

    </script>   </h:head>

 </f:view> 
 </html>

I get the follwoing error;

The value of the attribute "xmlns:ipp" is invalid. Prefixed namespace bindings may not be empty.

Is there a namespace value I can use?

2

There are 2 best solutions below

0
On BEST ANSWER

I've got a workaround for JSF here. Worked for me.

You need to rewrite a bit the JavaScript file that QBO provides for the button and menu functionality. You can download it from here.

If you have implemented all the OAuth and stuff, then you just need to add the tags without 'ipp' prefix. Just insert like this:

<connectToIntuit></connectToIntuit>
<blueDot></blueDot>

No namespaces needed. JSF will just ignore unknown tag and the JS have the ability to insert html and events into it.

I've downloaded easyUI JS as well from here. Insert the JS-es you've downloaded like this:

<script type="text/javascript" src="#{request.contextPath}/js/jquery/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="#{request.contextPath}/js/intuit.ipp.anywhere.js"></script>

It is required to insert jQuery version not less than 1.4.4.

The last thing left is the call of 'setup' js-function:

<script>
intuit.ipp.anywhere.setup({
    menuProxy: '#{request.scheme}://#{request.serverName}#{request.contextPath}/qb_blueDotMenu.jsf',
    grantUrl: '#{request.scheme}://#{request.serverName}#{request.contextPath}/qb_requestToken.jsf'
    });
</script>

where qb_blueDotMenu.jsf - is the servlet that render BlueDotMenu and qb_requestToken.jsf - is the RequestTokenServlet that gets the OAuth request token like show in QuickBooks Sample App.

Let me know if you got questions.

0
On

This is probably late, but I had the same issue and solved it by displaying the ipp:connectToIntuit button with

<h:outputText value="#{bean.ippConnect}" escape="false"  />