merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 4116280b5f33c3749264b22981b659b1066cff11
parent 89c5d1fc4422f5aa7ca4989677ebe58885382671
Author: Florian Dold <florian.dold@gmail.com>
Date:   Wed,  6 Apr 2016 02:29:01 +0200

use executePayment from web-common

Diffstat:
Mexamples/blog/essay_cc-form.html | 11+----------
Mexamples/blog/essay_fulfillment.php | 2+-
Mexamples/shop/fulfillment.php | 15+++------------
3 files changed, 5 insertions(+), 23 deletions(-)

diff --git a/examples/blog/essay_cc-form.html b/examples/blog/essay_cc-form.html @@ -21,6 +21,7 @@ <html> <head> <link rel="stylesheet" type="text/css" href="web-common/style.css"> + <link rel="stylesheet" type="text/css" href="web-common/taler-wallet-lib.js"> </head> <body style="display:none;" lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> <header> @@ -114,16 +115,6 @@ false); timer = window.setTimeout(handleTimeout, 250); - - function executePayment(H_contract, pay_url, offering_url) { - var detail = { - H_contract: H_contract, - pay_url: pay_url, - offering_url: offering_url - }; - var eve = new CustomEvent('taler-execute-payment', {detail: detail}); - document.dispatchEvent(eve); - } </script> <script type="application/javascript" src="web-common/taler-presence.js"></script> diff --git a/examples/blog/essay_fulfillment.php b/examples/blog/essay_fulfillment.php @@ -79,7 +79,7 @@ $hc = json_decode($resp->body->toString(), true)['H_contract']; $my_payment['hc'] = $hc; log_string("sending payment event"); - $js_code = "executePayment(\"$hc\", \"$pay_url\", \"$offering_url\");"; + $js_code = "taler.executePayment(\"$hc\", \"$pay_url\", \"$offering_url\");"; $cc_page = template("./essay_cc-form.html", array('article' => $article, 'jscode' => $js_code)); echo $cc_page; return; diff --git a/examples/shop/fulfillment.php b/examples/shop/fulfillment.php @@ -18,17 +18,8 @@ <head> <title>Taler's "Demo" Shop</title> <link rel="stylesheet" type="text/css" href="web-common/style.css"> - <script type="application/javascript" src="web-common/taler-presence.js"></script> + <script type="application/javascript" src="web-common/taler-wallet-lib.js"></script> <script type="application/javascript"> - function executePayment(H_contract, pay_url, offering_url) { - var detail = { - H_contract: H_contract, - pay_url: pay_url, - offering_url: offering_url - }; - var eve = new CustomEvent('taler-execute-payment', {detail: detail}); - document.dispatchEvent(eve); - } function makeVisible() { function cb() { document.body.style.display = ""; @@ -81,7 +72,7 @@ if (null === $my_payment) { // TODO: show spinner after timeout echo "<p>you do not have the session state for this contract: " . $hc . "</p>"; echo "<p>Asking the wallet to re-execute it ... </p>"; - echo "<script>executePayment('$hc', '$pay_url', '$offering_url');</script>"; + echo "<script>taler.executePayment('$hc', '$pay_url', '$offering_url');</script>"; return; } @@ -89,7 +80,7 @@ if (true !== get($my_payment["is_payed"], false)) { // TODO: show spinner after timeout echo "<p>you have not payed for this contract: " . $hc . "</p>"; echo "<p>Asking the wallet to re-execute it ... </p>"; - echo "<script>executePayment('$hc', '$pay_url');</script>"; + echo "<script>taler.executePayment('$hc', '$pay_url');</script>"; return; }