summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2015-10-23 13:12:36 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2015-10-23 13:12:36 +0200
commit1ca15d8f10a8c4b6860eeccf30899252eb6c3b79 (patch)
treec4ac158ef54432ccc8419c9aafe5bb9173cc350d
parentce642426bbdf32bde728f1daa36ef2c4ecf5d94d (diff)
parent3f3da5006eb32fa99da054b005adf42c6644d4a5 (diff)
downloadmerchant-1ca15d8f10a8c4b6860eeccf30899252eb6c3b79.tar.gz
merchant-1ca15d8f10a8c4b6860eeccf30899252eb6c3b79.tar.bz2
merchant-1ca15d8f10a8c4b6860eeccf30899252eb6c3b79.zip
Merge branch 'master' of ssh://taler.net/var/git/merchant
-rw-r--r--src/frontend/checkout.php5
-rw-r--r--src/frontend/generate_taler_contract.php65
2 files changed, 43 insertions, 27 deletions
diff --git a/src/frontend/checkout.php b/src/frontend/checkout.php
index 9b64b109..72e78944 100644
--- a/src/frontend/checkout.php
+++ b/src/frontend/checkout.php
@@ -76,7 +76,10 @@
pass it to the extension */
function handle_contract(json_contract)
{
- var cEvent = new CustomEvent('taler-contract', { 'detail' : json_contract });
+ var cEvent = new CustomEvent('taler-contract',
+ { detail: json_contract,
+ target: "/taler/pay"});
+
document.body.dispatchEvent(cEvent);
};
diff --git a/src/frontend/generate_taler_contract.php b/src/frontend/generate_taler_contract.php
index 3162517d..33cb2a47 100644
--- a/src/frontend/generate_taler_contract.php
+++ b/src/frontend/generate_taler_contract.php
@@ -76,35 +76,48 @@ $teatax = array ('value' => 1,
$json = json_encode (array ('amount' => array ('value' => $value,
'fraction' => $fraction,
'currency' => $currency),
- 'max fee' => array ('value' => 3,
+ 'max_fee' => array ('value' => 3,
'fraction' => 01010,
'currency' => $currency),
'trans_id' => $transaction_id,
- 'details' =>
- array ('items' =>
- array ('description' => $desc,
- 'quantity' => 1,
- 'itemprice' => array ('value' => $value,
- 'fraction' => $fraction,
- 'currency' => $currency)),
- 'product_id' => $p_id,
- 'taxes' => array (array ('teatax' => $teatax)),
- 'delivery_date' => "Some Date Format",
- 'delivery location' => 'LNAME1',
- 'merchant' => array ('address' => 'LNAME2',
- 'name' => 'test merchant',
- 'jurisdiction' =>
- array ('country' => 'Test Country',
- 'city' => 'Test City',
- 'state' => 'Test State',
- 'region' => 'Test Region',
- 'province' => 'Test Province',
- 'ZIP code' => 4908)),
- 'L-names' => array (array ('LNAME1' => 'Test Address 1',
- 'LNAME2' => 'Test Address 2')))));//,
- //JSON_PRETTY_PRINT);
-
-if ($cli_debug && FALSE)
+ 'products' => array (
+ array ('description' => $desc,
+ 'quantity' => 1,
+ 'price' => array ('value' => $value,
+ 'fraction' => $fraction,
+ 'currency' => $currency),
+ 'product_id' => $p_id,
+ 'taxes' => array (array ('teatax' => $teatax)),
+ 'delivery_date' => "Some Date Format",
+ 'delivery_location' => 'LNAME1')),
+ 'merchant' => array ('address' => 'LNAME2',
+ 'name' => 'test merchant',
+ 'jurisdiction' => 'LNAME3'),
+
+ 'locations' => array ('LNAME1' => array ('country' => 'Test Country',
+ 'city' => 'Test City',
+ 'state' => 'Test State',
+ 'region' => 'Test Region',
+ 'province' => 'Test Province',
+ 'ZIP code' => 4908,
+ 'street' => 'test street',
+ 'street number' => 20),
+ 'LNAME2' => array ('country' => 'Test Country',
+ 'city' => 'Test City',
+ 'state' => 'Test State',
+ 'region' => 'Test Region',
+ 'province' => 'Test Province',
+ 'ZIP code' => 4908,
+ 'street' => 'test street',
+ 'street number' => 20),
+ 'LNAME3' => array ('country' => 'Test Country',
+ 'city' => 'Test City',
+ 'state' => 'Test State',
+ 'region' => 'Test Region',
+ 'province' => 'Test Province',
+ 'ZIP code' => 4908)))); //, JSON_PRETTY_PRINT);
+
+if ($cli_debug && TRUE)
{
echo $json . "\n";
exit;