by IrongateE » Mon Jul 22, 2013 3:30 pm
For anyone else looking for a solution to this problem, I was able to successfully circumnavigate the issue using a combination of a server config file (could also be done with a .htaccess file) and ShopSite 11's Utilities > Applications setup. The steps went as follows:
1) Create application keys for your ShipWorks integration in Utilities > Applications
2) Create a new folder with IP access limited to your ShipWorks computer's public IP via .htaccess for security (you'll need a dedicated IP to do this, or change it every time your IP changes)
3) Make an empty file called db_xml.cgi in that folder to satisfy ShipWork's requirement for a filepath that includes 'db_xml.cgi' when you add your ShopSite store
4) Create an .htaccess rewrite rule that redirects all requests to the db_xml.cgi file you just made to a custom script written in your favorite language. This script needs to utilize ShopSite's OAuth framework and the applications keys generated in step 1 above
5) Build your custom script so it grabs any parameters received from ShipWorks and sends them off to ShopSite
6) Have your script print the response from the oAuth request
7) ShipWorks will read the response and fetch orders from it
Note: If you don't create the IP restriction then anyone who hits the URL of your script will see all the orders in your store, so make sure this is set up properly. Obscurity is no replacement for security. Also, this directory should only be accessed from ShipWorks via SSL (https://...../db_xml.cgi) to prevent eavesdropping on the data transfer.
I omitted sending the 'pay' param from ShipWorks to ShopSite, as I have no reason for ShipWorks to get that data, and I didn't want any unnecessary and sensitive data being transmitted. In fact, I set up the application in ShopSite to not grant access to that data either, so there would be no way that could get intercepted.
Hope that helps anyone attempting a ShipWorks-ShopSite integration. Honestly, I don't know why ShipWorks hasn't fixed this issue, as it doesn't seem very difficult to implement.
-Glen
References ------------------------------
.htacces starting point: http://httpd.apache.org/docs/current/howto/htaccess.html
ShopSite OAuth: http://www.shopsite.com/help/11.2/en-US/sc/pro/index.htm?page=/help/11.2/en-US/sc/pro/orders.download.format.xml-auto.html
Last edited by
IrongateE on Tue Jul 23, 2013 3:48 pm, edited 1 time in total.