summaryrefslogtreecommitdiff
path: root/src/frontend/generate_taler_contract.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/generate_taler_contract.php')
-rw-r--r--src/frontend/generate_taler_contract.php23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/frontend/generate_taler_contract.php b/src/frontend/generate_taler_contract.php
index 1b9648bb..52e11940 100644
--- a/src/frontend/generate_taler_contract.php
+++ b/src/frontend/generate_taler_contract.php
@@ -23,10 +23,27 @@
2. generate the JSON to forward to the backend
3. forward the response with the contract from the backend to
to the wallet
-*/
-$cli_debug = true;
+
+ To test this feature from the command line, issue:
+
+ - $ curl http://merchant_url/generate_taler_contract.php?cli_debug=yes
+ if the whole "journey" to the backend is begin tested
+ - $ curl http://merchant_url/generate_taler_contract.php?backend_test=no
+ if just the frontend job is being tested
+*/
+
+$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;
+}
+
// 1) recover the session information
session_start();
if (!$cli_debug && ((! isset($_SESSION['receiver'])) ||
@@ -84,7 +101,7 @@ $json = json_encode (array ('amount' => array ('value' => $value,
'max_fee' => array ('value' => 3,
'fraction' => 01010,
'currency' => $currency),
- 'trans_id' => $transaction_id,
+ 'transaction_id' => $transaction_id,
'products' => array (
array ('description' => $desc,
'quantity' => 1,