diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2015-10-26 17:00:30 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2015-10-26 17:00:30 +0100 |
commit | 125c9ec8da551943965e7405b78675cb8013a31b (patch) | |
tree | 890bf3dcb6648599620bd54a93db43ccc448937e | |
parent | 4254332bd1bd01c41088a158d21d3e1e4ab4eb90 (diff) | |
download | merchant-125c9ec8da551943965e7405b78675cb8013a31b.tar.gz merchant-125c9ec8da551943965e7405b78675cb8013a31b.tar.bz2 merchant-125c9ec8da551943965e7405b78675cb8013a31b.zip |
moving dating in frontend
-rw-r--r-- | src/frontend/generate_taler_contract.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/frontend/generate_taler_contract.php b/src/frontend/generate_taler_contract.php index 33cb2a47..bcfeaeb9 100644 --- a/src/frontend/generate_taler_contract.php +++ b/src/frontend/generate_taler_contract.php @@ -48,6 +48,7 @@ else { $receiver = "Test Receiver"; $amount = 5; + $currency = "Test"; } @@ -71,6 +72,9 @@ $teatax = array ('value' => 1, 'fraction' => 0, 'currency' => $currency); +// Take a timestamp +$now = new DateTime('now'); + // pack the JSON for the contract // --- FIXME: exact format needs review! $json = json_encode (array ('amount' => array ('value' => $value, @@ -90,6 +94,8 @@ $json = json_encode (array ('amount' => array ('value' => $value, 'taxes' => array (array ('teatax' => $teatax)), 'delivery_date' => "Some Date Format", 'delivery_location' => 'LNAME1')), + 'timestamp' => "Date(" . $now->getTimestamp() . ")", + 'refund_deadline' => "Date(" . $now->add(new DateInterval('P3M'))->getTimestamp() . ")", 'merchant' => array ('address' => 'LNAME2', 'name' => 'test merchant', 'jurisdiction' => 'LNAME3'), @@ -115,9 +121,9 @@ $json = json_encode (array ('amount' => array ('value' => $value, 'state' => 'Test State', 'region' => 'Test Region', 'province' => 'Test Province', - 'ZIP code' => 4908)))); //, JSON_PRETTY_PRINT); + 'ZIP code' => 4908))), JSON_PRETTY_PRINT); -if ($cli_debug && TRUE) +if ($cli_debug) { echo $json . "\n"; exit; |