FreshBooks Integration

From MTHWiki

Jump to: navigation, search

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