gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated (73d9a89 -> d0ffaaf)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (73d9a89 -> d0ffaaf)
Date: Fri, 10 Mar 2017 18:07:41 +0100

This is an automated email from the git hooks/post-receive script.

marcello pushed a change to branch master
in repository merchant.

    from 73d9a89  Restoring the macro-based way of passing values to payments 
generator.
     new eec82c7  README.
     new d0ffaaf  Calling the function (still a stub) that works out wire 
transfers tracks before returning that to the frontend.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/backend/taler-merchant-httpd_track-transfer.c | 35 ++++++++++++++++++++---
 src/samples/README                                | 13 +++++++++
 2 files changed, 44 insertions(+), 4 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_track-transfer.c 
b/src/backend/taler-merchant-httpd_track-transfer.c
index 3635c1d..b273e99 100644
--- a/src/backend/taler-merchant-httpd_track-transfer.c
+++ b/src/backend/taler-merchant-httpd_track-transfer.c
@@ -157,6 +157,21 @@ free_transfer_track_context (struct TrackTransferContext 
*rctx)
   GNUNET_free (rctx);
 }
 
+/**
+ * Transform /track/transfer result as gotten from the exchange
+ * and transforms it in a format liked by the backoffice Web interface.
+ *
+ * @param result response from exchange's /track/transfer
+ * @result pointer to new JSON, or NULL upon errors.
+ */
+json_t *
+transform_response (const json_t *result)
+{
+  json_t *response;
+
+  response = json_object ();
+  return response;
+}
 
 /**
  * Resume the given /track/transfer operation and send the given response.
@@ -287,6 +302,7 @@ wire_transfer_cb (void *cls,
   struct TrackTransferContext *rctx = cls;
   unsigned int i;
   int ret;
+  json_t *jresponse;
 
   rctx->wdh = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -403,10 +419,21 @@ wire_transfer_cb (void *cls,
     }
   }
   rctx->original_response = NULL;
-  resume_track_transfer_with_response
-    (rctx,
-     MHD_HTTP_OK,
-     TMH_RESPONSE_make_json (json));
+  /* FIXME, implement response transformator. Handle error as well. */
+  if (NULL == (jresponse = transform_response (json)))
+  {
+    resume_track_transfer_with_response
+      (rctx,
+       MHD_HTTP_INTERNAL_SERVER_ERROR,
+       TMH_RESPONSE_make_internal_error 
(TALER_EC_TRACK_TRANSFER_JSON_RESPONSE_ERROR,
+                                         "Fail to elaborate the response."));
+    return;
+  }
+
+  resume_track_transfer_with_response (rctx,
+                                       MHD_HTTP_OK,
+                                       TMH_RESPONSE_make_json (jresponse));
+  json_decref (jresponse);
 }
 
 
diff --git a/src/samples/README b/src/samples/README
index 4926db6..cfd0cb3 100644
--- a/src/samples/README
+++ b/src/samples/README
@@ -1,3 +1,16 @@
 Here is the logic that creates dummy payments into the
 merchant's DB, mainly used for debugging applications that
 need some real data from the merchant backend. 
+
+The tool taler-merchant-generate-payments needs three values:
+
+1 exchange URL
+2 merchant backend URL
+3 bank URL
+4 currency
+
+The tool reads these values from #define'd macros, so you should
+change them and recompile the code in order to make them fit your
+needs.
+
+We wish to get this tool reading those values via a config file!

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]