Skip to content
This repository was archived by the owner on Nov 11, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions bitpay/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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));
}

Expand All @@ -73,4 +63,4 @@ function deleteOldInvs() {
closedir($handle);
}
}
?>
?>
5 changes: 2 additions & 3 deletions bitpay/redirect2bitpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -44,4 +43,4 @@
// redirect to bitpay
header('Location: '.$invoice['url']);

?>
?>