From af03e45182f4f450621ce98a6bd23bfaf2671c59 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Tue, 23 Feb 2016 17:12:18 +0100 Subject: addressing #4197, to test --- src/frontend_blog/essay_fulfillment.php | 91 --------------------------------- 1 file changed, 91 deletions(-) delete mode 100644 src/frontend_blog/essay_fulfillment.php (limited to 'src/frontend_blog/essay_fulfillment.php') diff --git a/src/frontend_blog/essay_fulfillment.php b/src/frontend_blog/essay_fulfillment.php deleted file mode 100644 index d6526f9b..00000000 --- a/src/frontend_blog/essay_fulfillment.php +++ /dev/null @@ -1,91 +0,0 @@ - -*/ - include '../frontend_lib/util.php'; - include '../frontend_lib/merchants.php'; - include '../frontend_lib/config.php'; - include './blog_lib.php'; - - $article = get($_GET['article']); - if (null == $article){ - http_response_code(400); - echo message_from_missing_param("article", "/"); - return; - } - session_start(); - $payments = &pull($_SESSION, 'payments', array()); - $my_payment = &pull($payments, $article, array()); - $pay_url = url_rel("essay_pay.php"); - $offering_url = url_rel("essay_fulfillment.php", true); - $offering_url .= "?article=$article"; - //FIXME ispayed not always defined; wrap around some check - if (false == $payments[$article]['ispayed'] || null === $my_payment){ - $tid = get($_GET['tid']); - $timestamp = get($_GET['timestamp']); - // 1st time - if (null == $tid || null == $timestamp){ - $js_code = "get_contract(\"$article\")"; - $cc_page = template("./essay_cc-form.html", array('article' => $article, 'jscode' => $js_code)); - echo $cc_page; - die(); - } - // restore contract - $now = new DateTime(); - $now->setTimestamp(intval($timestamp)); - - $contract_rec = _generate_contract(array("amount_value" => 0, - "amount_fraction" => 50000, - "currency" => $MERCHANT_CURRENCY, - "transaction_id" => intval($tid), - "description" => trim(get_title($article)), - "product_id" => $article, - "correlation_id" => $article, - "taxes" => array(), - "now" => $now, - "fulfillment_url" => get_full_uri())); - /* - $contract_rec = generate_contract(0, - 50000, - $MERCHANT_CURRENCY, - intval($tid), - trim(get_title($article)), - $article, - $article, - array(), - $now, - get_full_uri());*/ - $resp = give_to_backend($_SERVER['HTTP_HOST'], - "backend/contract", - $contract_rec); - if ($resp->getResponseCode() != 200){ - echo json_encode(array( - 'error' => "internal error", - 'hint' => "non hashable contract", - 'detail' => $resp->body->toString() - ), JSON_PRETTY_PRINT); - die(); - } - $hc = json_decode($resp->body->toString(), true)['H_contract']; - $my_payment['hc'] = $hc; - $js_code = "executePayment('$hc', '$pay_url', '$offering_url')"; - $cc_page = template("./essay_cc-form.html", array('article' => $article, 'jscode' => $js_code)); - echo $cc_page; - return; - } - // control here == article payed - $article = get_article($article); - echo $article; -?> -- cgit v1.2.3