Fix potential problem with debug mode

The code for the API gateway has been changed to not try and log the
entire order object, which can potentially cause problems with many PHP
installs due to resource and recursion limits.