diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2015-11-19 22:59:24 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2015-11-19 22:59:24 +0100 |
commit | ba15286f27a34c69eb348ce3b8d9aa5764eb4905 (patch) | |
tree | 3534e24c42bcfcdd4df1404b9aad12011a5fdd65 | |
parent | 56544e30627d5e9dc0b71408e2ace74b1fe66f8a (diff) | |
download | merchant-ba15286f27a34c69eb348ce3b8d9aa5764eb4905.tar.gz merchant-ba15286f27a34c69eb348ce3b8d9aa5764eb4905.tar.bz2 merchant-ba15286f27a34c69eb348ce3b8d9aa5764eb4905.zip |
Adding 'amount' field in deposit permission sent to backend
-rw-r--r-- | src/frontend/pay.php | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/frontend/pay.php b/src/frontend/pay.php index b5061d39..97ee5290 100644 --- a/src/frontend/pay.php +++ b/src/frontend/pay.php @@ -25,9 +25,21 @@ */ +$cli_debug = false; +$backend_test = true; + +if ($_GET['cli_debug'] == 'yes') + $cli_debug = true; + +if ($_GET['backend_test'] == 'no') +{ + $cli_debug = true; + $backend_test = false; +} + session_start(); -if (! isset($_SESSION['receiver'])) +if (!$cli_debug && (! isset($_SESSION['receiver']))) { http_response_code(400); echo "Please, donate to someone before landing here!"; @@ -53,11 +65,15 @@ $edate = array ('edate' => "/Date(" . $now->add(new DateInterval('P2W'))->getTimestamp() . ")/"); $deposit_permission = json_decode ($post_body, true); -$max_fee = array ('max_fee' => array ('value' => 3, + +$to_add = array ('max_fee' => array ('value' => 3, 'fraction' => 8, - 'currency' => "KUDOS")); + 'currency' => $_SESSION['currency']), + 'amount' => array ('value' => $_SESSION['amount_value'], + 'fraction' => $_SESSION['amount_fraction'], + 'currency' => $_SESSION['currency'])); -$new_deposit_permission = array_merge ($deposit_permission, $max_fee); +$new_deposit_permission = array_merge ($deposit_permission, $to_add); $new_deposit_permission_edate = array_merge ($new_deposit_permission, $edate); /* Craft the HTTP request, note that the backend |