gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 01/19: First steps in renaming


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 01/19: First steps in renaming
Date: Fri, 10 Feb 2017 14:22:52 +0100

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

marcello pushed a commit to branch master
in repository merchant.

commit ccb8c161a227e8b3678472ce7006e911073bbdfb
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Feb 2 17:18:49 2017 +0100

    First steps in renaming
---
 doc/version.texi                                   |  2 +-
 src/backend/Makefile.am                            |  2 +-
 ...d_propose.c => taler-merchant-httpd_proposal.c} |  0
 src/lib/Makefile.am                                |  2 +-
 ...hant_api_contract.c => merchant_api_proposal.c} | 19 +++----
 src/lib/test_merchant_api.c                        | 58 +++-------------------
 6 files changed, 20 insertions(+), 63 deletions(-)

diff --git a/doc/version.texi b/doc/version.texi
index 13bfa00..0b47203 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
address@hidden UPDATED 8 January 2017
address@hidden UPDATED 27 January 2017
 @set UPDATED-MONTH January 2017
 @set EDITION 0.2.0
 @set VERSION 0.2.0
diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am
index 9a5b2d6..db782fe 100644
--- a/src/backend/Makefile.am
+++ b/src/backend/Makefile.am
@@ -19,7 +19,7 @@ taler_merchant_httpd_SOURCES = \
   taler-merchant-httpd_mhd.c taler-merchant-httpd_mhd.h \
   taler-merchant-httpd_auditors.c taler-merchant-httpd_auditors.h \
   taler-merchant-httpd_exchanges.c taler-merchant-httpd_exchanges.h \
-  taler-merchant-httpd_propose.c taler-merchant-httpd_propose.h \
+  taler-merchant-httpd_proposal.c taler-merchant-httpd_proposal.h \
   taler-merchant-httpd_pay.c taler-merchant-httpd_pay.h \
   taler-merchant-httpd_history.c taler-merchant-httpd_history.h \
   taler-merchant-httpd_track-transaction.c 
taler-merchant-httpd_track-transaction.h \
diff --git a/src/backend/taler-merchant-httpd_propose.c 
b/src/backend/taler-merchant-httpd_proposal.c
similarity index 100%
rename from src/backend/taler-merchant-httpd_propose.c
rename to src/backend/taler-merchant-httpd_proposal.c
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index d862365..34388bc 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -14,7 +14,7 @@ libtalermerchant_la_LDFLAGS = \
   -no-undefined
 
 libtalermerchant_la_SOURCES = \
-  merchant_api_contract.c \
+  merchant_api_proposal.c \
   merchant_api_pay.c \
   merchant_api_track_transaction.c \
   merchant_api_track_transfer.c \
diff --git a/src/lib/merchant_api_contract.c b/src/lib/merchant_api_proposal.c
similarity index 92%
rename from src/lib/merchant_api_contract.c
rename to src/lib/merchant_api_proposal.c
index c5db8d3..f185890 100644
--- a/src/lib/merchant_api_contract.c
+++ b/src/lib/merchant_api_proposal.c
@@ -15,9 +15,10 @@
   <http://www.gnu.org/licenses/>
 */
 /**
- * @file lib/merchant_api_contract.c
- * @brief Implementation of the /contract request of the merchant's HTTP API
+ * @file lib/merchant_api_proposal.c
+ * @brief Implementation of the /proposal PUT and GET
  * @author Christian Grothoff
+ * @author Marcello Stanisci
  */
 #include "platform.h"
 #include <curl/curl.h>
@@ -158,8 +159,8 @@ handle_contract_finished (void *cls,
 
 
 /**
- * Request backend to sign a contract (and add fields like wire transfer
- * details).
+ * PUT an order to the backend and receives the related
+ * proposal.
  *
  * @param ctx execution context
  * @param backend_uri URI of the backend
@@ -169,11 +170,11 @@ handle_contract_finished (void *cls,
  * @return a handle for this request
  */
 struct TALER_MERCHANT_ContractOperation *
-TALER_MERCHANT_contract_sign (struct GNUNET_CURL_Context *ctx,
-                              const char *backend_uri,
-                              const json_t *contract,
-                              TALER_MERCHANT_ContractCallback contract_cb,
-                              void *contract_cb_cls)
+TALER_MERCHANT_put_order (struct GNUNET_CURL_Context *ctx,
+                          const char *backend_uri,
+                          const json_t *order,
+                          TALER_MERCHANT_ProposalCallback proposal_cb,
+                          void *proposal_cb_cls)
 {
   struct TALER_MERCHANT_ContractOperation *co;
   json_t *req;
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index f2081c2..2705e86 100644
--- a/src/lib/test_merchant_api.c
+++ b/src/lib/test_merchant_api.c
@@ -132,12 +132,6 @@ enum OpCode
   OC_END = 0,
 
   /**
-   * Ask the backend to store a contract and its hashcode into
-   * the database.
-   */
-  OC_MAP_IN,
-
-  /**
    * Ask the backend to retrieve a contract from the database, according
    * to its hashcode.
    */
@@ -1499,7 +1493,6 @@ interpreter_run (void *cls)
                                          is);
     return;
 
-  case OC_MAP_IN:
   case OC_MAP_OUT:
   {
     struct GNUNET_HashCode h_proposal;
@@ -1521,29 +1514,13 @@ interpreter_run (void *cls)
     GNUNET_assert (GNUNET_SYSERR !=
                    TALER_JSON_hash (proposal, &h_proposal));
 
-    if (OC_MAP_IN == cmd->oc)
-    {
-
-      if (MHD_HTTP_UNPROCESSABLE_ENTITY == cmd->expected_response_code)
-        RND_BLK (&h_proposal);
-
-      GNUNET_assert (NULL !=
-                      (cmd->details.map.mo
-                       = TALER_MERCHANT_map_in (ctx,
-                                                MERCHANT_URI,
-                                                proposal,
-                                                &h_proposal,
-                                                map_cb,
-                                                is)));
-    }
-   else
-     GNUNET_assert (NULL !=
-                     (cmd->details.map.mo 
-                      = TALER_MERCHANT_map_out (ctx,
-                                                MERCHANT_URI,
-                                                &h_proposal,
-                                                map_cb,
-                                                is)));
+    GNUNET_assert (NULL !=
+                    (cmd->details.map.mo 
+                     = TALER_MERCHANT_map_out (ctx,
+                                               MERCHANT_URI,
+                                               &h_proposal,
+                                               map_cb,
+                                               is)));
   
   }
     return;
@@ -2033,7 +2010,6 @@ do_shutdown (void *cls)
     case OC_END:
       GNUNET_assert (0);
       break;
-    case OC_MAP_IN:
     case OC_MAP_OUT:
       if (NULL != cmd->details.map.mo)
       {
@@ -2301,12 +2277,6 @@ run (void *cls)
       .details.pay.amount_with_fee = "EUR:5",
       .details.pay.amount_without_fee = "EUR:4.99" },
 
-    /* Store contract-1 */
-    {
-      .oc = OC_MAP_IN, 
-      .label = "store-contract-1",
-      .expected_response_code = MHD_HTTP_OK,
-      .details.map.contract_reference = "create-contract-1" },
 
     /* Create another contract */
     { .oc = OC_CONTRACT,
@@ -2341,14 +2311,6 @@ run (void *cls)
       .details.admin_add_incoming.transfer_details = "{ \"uuid\": 2}",
       .details.admin_add_incoming.amount = "EUR:1" },
 
-    /* Store contract-1 */
-    {
-      .oc = OC_MAP_IN, 
-      .label = "store-contract-2",
-      .expected_response_code = MHD_HTTP_OK,
-      .details.map.contract_reference = "create-contract-2",
-    },
-
     /* Add another 4.01 EUR to reserve #2 */
     { .oc = OC_ADMIN_ADD_INCOMING,
       .label = "create-reserve-2b",
@@ -2523,12 +2485,6 @@ run (void *cls)
                   \"products\":\
                      [ {\"description\":\"bogus\", \"value\":\"{EUR:1}\"} ] }" 
},
 
-    /* Try to store a contract passing a bogus hashcode. */
-    {
-      .oc = OC_MAP_IN, 
-      .label = "store-contract-bogus",
-      .expected_response_code = MHD_HTTP_UNPROCESSABLE_ENTITY,
-      .details.map.contract_reference = "create-contract-3" },
     /* end of testcase */
     { .oc = OC_END }
   };

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



reply via email to

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