Toy Store - Product Page
Bad request (article missing)";
return;
}
session_start();
$payments = get($_SESSION['payments'], array());
$my_payment = get($payments[$hc]);
$pay_url = url_rel("essay_pay.php");
$offering_url = url_rel("essay_offer.php", true);
$offering_url .= "?article=$article";
file_put_contents("/tmp/ffilproc", $offering_url);
if (true !== get($my_payment["is_payed"], false) || null === $my_payment)
{
$tid = get('tid');
$timestamp = get('timestamp');
// FIXME article name should be "melted" in the hash
// TODO reconstruct *here* the contract, hash it, and save it in the state
if (null == $tid || null == $timestamp){
// CC case
$_SESSION['cc_payment'] = true;
$cc_page = template("./essay_cc-payment.html", array('article' => $article));
echo $cc_page;
die();
}
echo "Paying ... at $pay_url
";
echo "";
return;
}
// control here == article payed
$article = $my_payment["article"];
$article_doc = get_article($article);
echo $article_doc->saveHTML();
?>