Index: branches/5.2.x/units/gateways/gw_classes/google_checkout.php =================================================================== diff -u -N -r14258 -r14582 --- branches/5.2.x/units/gateways/gw_classes/google_checkout.php (.../google_checkout.php) (revision 14258) +++ branches/5.2.x/units/gateways/gw_classes/google_checkout.php (.../google_checkout.php) (revision 14582) @@ -1,6 +1,6 @@ Application->isDebugMode()) { - $fp = fopen(FULL_PATH.'/xml_request.html', 'a'); - fwrite($fp, '--- '.adodb_date('Y-m-d H:i:s').' ---'."\n".$xml_data); - fclose($fp); + if ( $this->Application->isDebugMode() ) { + $this->toLog($xml_data, 'xml_request.html'); } return $xml_data; @@ -235,16 +233,27 @@ echo $xml_responce; - if ($this->Application->isDebugMode()) { - $fp = fopen(FULL_PATH.'/xml_responce.html', 'a'); - fwrite($fp, '--- '.adodb_date('Y-m-d H:i:s').' ---'."\n".$xml_responce."\n"); - fclose($fp); + if ( $this->Application->isDebugMode() ) { + $this->toLog($xml_responce, 'xml_responce.html'); } return $order_approvable ? 1 : 0; } /** + * Writes XML requests and responces to a file + * + * @param string $xml_data + * @param string $xml_file + */ + function toLog($xml_data, $xml_file) + { + $fp = fopen( (defined('RESTRICTED') ? RESTRICTED : FULL_PATH) . '/' . $xml_file, 'a' ); + fwrite($fp, '--- ' . adodb_date('Y-m-d H:i:s') . ' ---' . "\n" . $xml_data); + fclose($fp); + } + + /** * Processes notification * * @param kXMLNode $root_node