diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2015-10-29 11:33:03 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2015-10-29 11:33:03 +0100 |
commit | bfcb32339fbed0513090b0f546b04c90c11ea474 (patch) | |
tree | 2be543c0f888773972e745aafd9b9203f0144e2c /src/frontend | |
parent | 6d18f1bfba939c2446c86c1152c274029bd5d63c (diff) | |
download | merchant-bfcb32339fbed0513090b0f546b04c90c11ea474.tar.gz merchant-bfcb32339fbed0513090b0f546b04c90c11ea474.tar.bz2 merchant-bfcb32339fbed0513090b0f546b04c90c11ea474.zip |
- Adding cli debugging feature to contract generation (i.e. it is
possible to GET the frontend with 'curl' in order to invoke the
backend to generate a contract. See 'generate_taler_contract.php'
to get instructions on how to do it)
- Removing unneeded functions from the 'contract' shared library
(which presusmably will be entirely removed)
- Some minor fixes
Diffstat (limited to 'src/frontend')
-rw-r--r-- | src/frontend/generate_taler_contract.php | 23 |
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, |