From 9e03530c21c21d4b2b5e58a5fef92578761d1afa Mon Sep 17 00:00:00 2001 From: Rich Morgan Date: Fri, 16 May 2014 01:11:33 -0400 Subject: [PATCH 1/2] Fix to use server error handling --- bitpay/functions.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) 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 +?> From f41cc02ade1428c458099927ff066389d2d29165 Mon Sep 17 00:00:00 2001 From: Rich Morgan Date: Fri, 16 May 2014 01:12:43 -0400 Subject: [PATCH 2/2] Fix to use server error handling --- bitpay/redirect2bitpay.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 +?>