[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated: f
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated: fix /track scripts for php backoffice |
Date: |
Tue, 28 Mar 2017 16:51:10 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant-frontend-examples.
The following commit(s) were added to refs/heads/master by this push:
new 7d0b3fd fix /track scripts for php backoffice
7d0b3fd is described below
commit 7d0b3fdd257773866e29978453f9ebc89c099c51
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Mar 28 16:51:00 2017 +0200
fix /track scripts for php backoffice
---
php/backoffice.html | 1 +
php/doc/tutorial.texi | 4 ++--
php/track-transfer.php | 17 ++++-------------
3 files changed, 7 insertions(+), 15 deletions(-)
diff --git a/php/backoffice.html b/php/backoffice.html
index 4350179..eb27dea 100644
--- a/php/backoffice.html
+++ b/php/backoffice.html
@@ -14,6 +14,7 @@
<form action='/track-transfer.php' method='GET'>
<input type='text' name='wtid' placeholder='Wire transfer ID'></input>
<input type='text' name='exchange' placeholder='Exchange URL'></input>
+ <input type='text' name='instance' value="tutorial" hidden></input>
<input type='submit' value='Track transfer'></input>
</form>
<form id="history_form" action="" method="GET">
diff --git a/php/doc/tutorial.texi b/php/doc/tutorial.texi
index 63213f0..1bacd49 100644
--- a/php/doc/tutorial.texi
+++ b/php/doc/tutorial.texi
@@ -495,8 +495,8 @@ can be shown to the user.
@section Tracking a wire transfer
-To track a wire transfer, we first check if the user submitted all the
-required parameters, and then we forward the request to the backend.
+To track a wire transfer, the frontend just needs to forward the request
+it got from the Web form, to the backend.
Again, the backend may request missing information from the exchange,
verify signatures, persist the result and complain if there are
inconsistencies.
diff --git a/php/track-transfer.php b/php/track-transfer.php
index 2eb7151..d073465 100644
--- a/php/track-transfer.php
+++ b/php/track-transfer.php
@@ -5,17 +5,8 @@
include 'backend.php';
- if (!isset($_GET['wtid']) or !isset($_GET['exchange'])){
- build_error(array("body" => "Missing parameter"),
- "'wtid' or 'exchange' has not been submitted",
- 400);
- return;
- }
+ $response = get_to_backend("/track/transfer", $_GET);
- $wtid = $_GET['wtid'];
- $response = get_to_backend("/track/transfer",
- array("wtid" => $wtid,
- "exchange" => $_GET['exchange']));
if (!in_array($response["status_code"], array(200, 424))){
echo build_error($response,
"Backend error",
@@ -33,16 +24,16 @@
$body->coin_pub);
return;
}
- $json_response = json_decode($response["body"]);
+ $json_response = json_decode($response["body"]);
$pretty_date = get_pretty_date($json_response->execution_time);
$amount = get_amount($json_response->total);
echo "<p>$wtid: $amount transferred on $pretty_date.
The list of involved transactions is shown below:</p>";
echo "<ul>";
- foreach ($json_response->deposits as $entry){
- echo sprintf("<li>Transaction id: %s", $entry->transaction_id);
+ foreach ($json_response->deposits_sums as $entry){
+ echo sprintf("<li>Order id: %s", $entry->order_id);
}
echo "</ul>";
?>
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant-frontend-examples] branch master updated: fix /track scripts for php backoffice,
gnunet <=