merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit c4edac528d746747ff6d8015f00374f9c2a0c335
parent 2a270be0497b88c95936bfcd09b5ecd83141b94c
Author: Florian Dold <florian.dold@gmail.com>
Date:   Fri, 18 Dec 2015 16:05:49 +0100

Fix typo / code duplication

Diffstat:
Msrc/frontend/pay.php | 22++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/src/frontend/pay.php b/src/frontend/pay.php @@ -28,29 +28,19 @@ $cli_debug = false; $backend_test = true; -if ($_GET['cli_debug'] == 'yes') - $cli_debug = true; - -if ($_GET['backend_test'] == 'no') +if (isset($_GET['cli_debug']) && $_GET['cli_debug'] == 'yes') { $cli_debug = true; - $backend_test = false; } -session_start(); - -$cli_debug = false; -$backend_test = true; - -if ($_GET['cli_debug'] == 'yes') - $cli_debug = true; - -if ($_GET['backend_test'] == 'no') +if (isset($_GET['backend_test']) && $_GET['backend_test'] == 'no') { $cli_debug = true; $backend_test = false; } +session_start(); + $post_body = file_get_contents('php://input'); $now = new DateTime('now'); @@ -105,8 +95,8 @@ if ($status_code != 200) /* error: just forwarding to the wallet what gotten from the backend (which is forwarding 'as is' the error gotten from the mint) */ - echo "Error came from the backend\n"; - echo "json_encode ($new_deposit_permission)" + echo json_encode ($new_deposit_permission); + echo "Error came from the backend, status $status_code\n"; echo "\n"; echo $resp->body->toString (); }