FreshBooks Integration

From MTHWiki

(Difference between revisions)
Jump to: navigation, search
m (Reverted edits by Ogixidoni (Talk); changed back to last version by Wikiadmin)
Line 1: Line 1:
-
=[http://osobageqys.co.cc UNDER COSTRUCTION, PLEASE SEE THIS POST IN RESERVE COPY]=
 
== FreshBooks XSD Schema ==
== FreshBooks XSD Schema ==
Line 36: Line 35:
To enable FreshBooks communications debugging you will need to switch My Money into debug mode. To do so please open My Money Console and type
To enable FreshBooks communications debugging you will need to switch My Money into debug mode. To do so please open My Money Console and type
-
<code>
+
<code>
-
&lt;pre&gt;
+
<pre>
-
Environment.setProperty(&quot;freshbooks_debug&quot;,&quot;true&quot;);
+
Environment.setProperty("freshbooks_debug","true");
-
&lt;/pre&gt;
+
</pre>
-
&lt;/code&gt;
+
</code>
to validate that the variable was set please type
to validate that the variable was set please type
-
&lt;code&gt;
+
<code>
-
&lt;pre&gt;
+
<pre>
-
print (Environment.getProperty(&quot;freshbooks_debug&quot;));
+
print (Environment.getProperty("freshbooks_debug"));
-
&lt;/pre&gt;
+
</pre>
-
&lt;/code&gt;
+
</code>
this should return '''true'''
this should return '''true'''
Line 61: Line 60:
This file is normally written into My Money profile folder, which is located in the following possible places:
This file is normally written into My Money profile folder, which is located in the following possible places:
-
{| style=&quot;width:75%; height:200px&quot; style=&quot;border:1px dashed blue;&quot;
+
{| style="width:75%; height:200px" style="border:1px dashed blue;"
-
| Windows Vista || Users\&amp;lt;UserName&amp;gt;\AppData\Roaming\.mymoney
+
| Windows Vista || Users\&lt;UserName&gt;\AppData\Roaming\.mymoney
-
|- style=&quot;background:LightBlue&quot;
+
|- style="background:LightBlue"
-
| Windows 2000, XP, Server 2003 || Documents and Settings\&amp;lt;UserName&amp;gt;\Application Data\.mymoney
+
| Windows 2000, XP, Server 2003 || Documents and Settings\&lt;UserName&gt;\Application Data\.mymoney
|-
|-
-
| Windows NT || WINNT\Profiles\&amp;lt;UserName&amp;gt;\Application Data\.mymoney
+
| Windows NT || WINNT\Profiles\&lt;UserName&gt;\Application Data\.mymoney
-
|- style=&quot;background:LightBlue&quot;
+
|- style="background:LightBlue"
| Mac OS X || ~\.mymoney
| Mac OS X || ~\.mymoney
|-
|-
Line 76: Line 75:
Once you have located the file you can open it with an text editor, you will see details of communications inside, the following fragment captures communications between My Money and Chase.
Once you have located the file you can open it with an text editor, you will see details of communications inside, the following fragment captures communications between My Money and Chase.
-
&lt;code&gt;
+
<code>
-
&lt;pre&gt;
+
<pre>
-
&gt;&gt;&gt;&gt; FreshBooks Connection Log: 2009-07-15POST https://xxxxx.freshbooks.com/api/2.1/xml-in:
+
>>>> FreshBooks Connection Log: 2009-07-15POST https://xxxxx.freshbooks.com/api/2.1/xml-in:
-
&lt;request method=&quot;invoice.list&quot;&gt;
+
<request method="invoice.list">
-
&lt;page&gt;1&lt;/page&gt;
+
<page>1</page>
-
&lt;/request&gt;
+
</request>
Response:
Response:
-
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
+
<?xml version="1.0" encoding="utf-8"?>
-
&lt;response xmlns=&quot;http://www.freshbooks.com/api/&quot; status=&quot;ok&quot;&gt;
+
<response xmlns="http://www.freshbooks.com/api/" status="ok">
-
&lt;invoices page=&quot;1&quot; per_page=&quot;25&quot; pages=&quot;1&quot; total=&quot;2&quot;&gt;
+
<invoices page="1" per_page="25" pages="1" total="2">
-
&lt;invoice&gt;
+
<invoice>
-
&lt;invoice_id&gt;00000000002&lt;/invoice_id&gt;
+
<invoice_id>00000000002</invoice_id>
.....
.....
-
&lt;/invoice&gt;
+
</invoice>
-
&lt;/invoices&gt;
+
</invoices>
-
&lt;/response&gt;
+
</response>
POST https://xxxxxx.freshbooks.com/api/2.1/xml-in:
POST https://xxxxxx.freshbooks.com/api/2.1/xml-in:
-
&lt;/pre&gt;
+
</pre>
-
&lt;/code&gt;
+
</code>
Line 110: Line 109:
2) type in in the command line
2) type in in the command line
-
&lt;code&gt;
+
<code>
-
&lt;pre&gt;
+
<pre>
cp ~/.mymoney/freshbooks_debug.log ~/Desktop
cp ~/.mymoney/freshbooks_debug.log ~/Desktop
-
&lt;/pre&gt;
+
</pre>
-
&lt;/code&gt;
+
</code>
3) Press enter, this will copy the log file to your desktop, if you minimize all windows you will see it
3) Press enter, this will copy the log file to your desktop, if you minimize all windows you will see it
Line 124: Line 123:
To disable debugging please type:
To disable debugging please type:
-
&lt;code&gt;
+
<code>
-
&lt;pre&gt;
+
<pre>
-
Environment.setProperty(&quot;freshbooks_debug&quot;,&quot;false&quot;);
+
Environment.setProperty("freshbooks_debug","false");
-
&lt;/pre&gt;
+
</pre>
-
&lt;/code&gt;
+
</code>
to validate that the variable was set off please type
to validate that the variable was set off please type
-
&lt;code&gt;
+
<code>
-
&lt;pre&gt;
+
<pre>
-
print (Environment.getProperty(&quot;freshbooks_debug&quot;));
+
print (Environment.getProperty("freshbooks_debug"));
-
&lt;/pre&gt;
+
</pre>
-
&lt;/code&gt;
+
</code>
this should return '''false'''
this should return '''false'''

Revision as of 13:37, 24 November 2010

Contents

FreshBooks XSD Schema

The original schema was generated by helpful folks at KNG Consulting, we cleaned it some and used it to generate JAXB Bindings

Media:FreshBooksApi.xsd‎


FreshBooks JAXB Objects

These are Java files generated from above, they were further cleaned, moved into appropriate package and ready to be used for jaxb processing

Media:Jaxb_schema.zip‎


Debugging FreshBooks Connections

My Money communicates with Freshbooks.com using FreshBooks open API. See developers page at FreshBooks for more information on this protocol.

Sometimes it is necessary to capture the details of this communication to troubleshoot a problem for example, or to better understand the details of what is going over the wire. My Money version 2.0.45 introduced an internal debug variable that could be switched on to save the details of this communication.


Security

My Money uses a combination of cryptographic protocols to provide secure communications on the Internet for data transfers. When communicating with the FreshBooks My Money uses Secure Socket Layer or SSL to protect data in transit from eavesdropping and man-in-the-middle attacks.

Please understand that enabling debugging of such communications will degrade this security, your information will be saved locally into text files that could be compromised. We strongly suggest to enable this debugging only for limited periods of time to troubleshoot a specific problem and disable it once the problem has been resolved.

Capturing communication details

To enable FreshBooks communications debugging you will need to switch My Money into debug mode. To do so please open My Money Console and type

Environment.setProperty("freshbooks_debug","true");

to validate that the variable was set please type

print (Environment.getProperty("freshbooks_debug"));

this should return true

See the screen shot for illustration:

Image:Fbdebug.PNG


Once the freshbooks_debug variable has been enabled all communication with the banks will be saved into a file freshbooks_debug.log

This file is normally written into My Money profile folder, which is located in the following possible places:

Windows Vista Users\<UserName>\AppData\Roaming\.mymoney
Windows 2000, XP, Server 2003 Documents and Settings\<UserName>\Application Data\.mymoney
Windows NT WINNT\Profiles\<UserName>\Application Data\.mymoney
Mac OS X ~\.mymoney
Linux and Unix systems ~\.mymoney


Once you have located the file you can open it with an text editor, you will see details of communications inside, the following fragment captures communications between My Money and Chase.


>>>> FreshBooks Connection Log: 2009-07-15POST https://xxxxx.freshbooks.com/api/2.1/xml-in:
<request method="invoice.list">
  <page>1</page>
</request>
Response:
<?xml version="1.0" encoding="utf-8"?>
<response xmlns="http://www.freshbooks.com/api/" status="ok">
  <invoices page="1" per_page="25" pages="1" total="2">
    <invoice>
      <invoice_id>00000000002</invoice_id>
.....    
    </invoice>
  </invoices>
</response>

POST https://xxxxxx.freshbooks.com/api/2.1/xml-in:


Locating Log Files

If you are on Mac/Linux the log file (freshbooks_debug.log) is in a hidden directory and will not be found using normal means.

To copy your log file to more accessible place please do the following:


1) Open up mac terminal application or linux console

2) type in in the command line

cp ~/.mymoney/freshbooks_debug.log ~/Desktop

3) Press enter, this will copy the log file to your desktop, if you minimize all windows you will see it


Disabling Debug

Once switched on debug will stay on between My Money sessions. You need to explicitly switch it off to return to normal security grade.

To disable debugging please type:

Environment.setProperty("freshbooks_debug","false");

to validate that the variable was set off please type

print (Environment.getProperty("freshbooks_debug"));

this should return false


We strongly suggest to delete the freshbooks_debug.log from the system once you finished troubleshooting FreshBooks issues.

Personal tools