diff --git a/bitpay/functions.php b/bitpay/functions.php index 54d0e70..4d4516e 100644 --- a/bitpay/functions.php +++ b/bitpay/functions.php @@ -2,14 +2,7 @@ function debuglog($contents) { - $file = 'log.txt'; - file_put_contents($file, date('m-d H:i:s').": ", FILE_APPEND); - if (is_array($contents)) - file_put_contents($file, var_export($contents, true)."\n", FILE_APPEND); - else if (is_object($contents)) - file_put_contents($file, json_encode($contents)."\n", FILE_APPEND); - else - file_put_contents($file, $contents."\n", FILE_APPEND); + error_log($contents); } function postToEcwid($notice) @@ -46,9 +39,6 @@ function postToEcwid($notice) $response = curl_exec($ch); if ($response === false){ debuglog('request to ecwid.com failed'); - debuglog($url); - debuglog($notice); - debuglog($datatopost); debuglog(curl_error($ch)); } @@ -73,4 +63,4 @@ function deleteOldInvs() { closedir($handle); } } -?> \ No newline at end of file +?> diff --git a/bitpay/redirect2bitpay.php b/bitpay/redirect2bitpay.php index bf1307f..6115ec0 100644 --- a/bitpay/redirect2bitpay.php +++ b/bitpay/redirect2bitpay.php @@ -32,8 +32,7 @@ $invoice = bpCreateInvoice(NULL, $_POST['x_amount'], $posData, $options); if (isset($invoice['error'])) { - debuglog($options); - debuglog($invoice); + debuglog('Error creating invoice'); print 'Error creating invoice'; die; } @@ -44,4 +43,4 @@ // redirect to bitpay header('Location: '.$invoice['url']); -?> \ No newline at end of file +?>