diff options
author | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-02-08 16:29:21 +0100 |
---|---|---|
committer | Marcello Stanisci <marcello.stanisci@inria.fr> | 2016-02-08 16:29:21 +0100 |
commit | cf011fb8ca7b9288a932258e88b1a67e4b20daa5 (patch) | |
tree | 65647478b58084051039fc6fdd045c151ae743a8 /src/frontend_blog/essay_contract.php | |
parent | 6a63d026586f7cdd6aa3664ff68157e5b445f3bc (diff) | |
download | merchant-cf011fb8ca7b9288a932258e88b1a67e4b20daa5.tar.gz merchant-cf011fb8ca7b9288a932258e88b1a67e4b20daa5.tar.bz2 merchant-cf011fb8ca7b9288a932258e88b1a67e4b20daa5.zip |
commit needed to look back in the history
Diffstat (limited to 'src/frontend_blog/essay_contract.php')
-rw-r--r-- | src/frontend_blog/essay_contract.php | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/frontend_blog/essay_contract.php b/src/frontend_blog/essay_contract.php index 265b5007..478e70fb 100644 --- a/src/frontend_blog/essay_contract.php +++ b/src/frontend_blog/essay_contract.php @@ -24,6 +24,7 @@ * */ include("../frontend_lib/merchants.php"); +include("../frontend_lib/util.php"); include("./blog_lib.php"); session_start(); if (!isset($_GET['article'])){ @@ -42,18 +43,30 @@ $teatax = array ('value' => 1, 'currency' => "KUDOS"); $now = new DateTime('now'); $teaser = get_teaser($article); -$pay_url = "essay_pay.php"; -$exec_url = "execute.php"; -$contract_json = generate_contract(1, - 0, - "KUDOS", + +$amount_value = 1; +$amount_fraction = 0; +$currency = "KUDOS"; +$transaction_id = rand(0, 1001); +// Include all information so we can +// restore the contract without storing it +$fulfillment_url = url_rel("essay_fulfillment.php") + . '?uuid=${H_contract}' + . '&article=' . urlencode($article) + . '&aval=' . urlencode($amount_value) + . '&afrac=' . urlencode($amount_fraction) + . '&acurr=' . urlencode($currency) + . '&tid=' . $transaction_id; +file_put_contents("/tmp/debg1", $fulfillment_url); +$contract_json = generate_contract($amount_value, + $amount_fraction, + $currency, $transaction_id, trim($teaser->nodeValue), $p_id, $teatax, $now, - $pay_url, - $exec_url); + $fulfillment_url); $resp = give_to_backend($_SERVER["HTTP_HOST"], "backend/contract", $contract_json); |