gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: update changes with git pull and


From: gnunet
Subject: [taler-merchant] branch master updated: update changes with git pull and push modification for post order and using templates
Date: Tue, 21 Feb 2023 17:51:14 +0100

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

priscilla-huang pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 9e92dc10 update changes with git pull and push modification for post 
order and using templates
9e92dc10 is described below

commit 9e92dc1004bedde592b14ad4a50071562a90ddd8
Author: priscilla <priscilla.huang@efrei.net>
AuthorDate: Tue Feb 21 11:50:53 2023 -0500

    update changes with git pull and push modification for post order and using 
templates
---
 .../taler-merchant-httpd_post-using-templates.c    |  7 ++-
 .../taler-merchant-httpd_private-post-orders.c     | 52 +++++++++++++++++-----
 2 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-using-templates.c 
b/src/backend/taler-merchant-httpd_post-using-templates.c
index aeb50cee..22a93847 100644
--- a/src/backend/taler-merchant-httpd_post-using-templates.c
+++ b/src/backend/taler-merchant-httpd_post-using-templates.c
@@ -45,8 +45,6 @@ TMH_post_using_templates_ID (const struct TMH_RequestHandler 
*rh,
   json_t *fake_body;
   bool no_summary;
   struct TALER_MERCHANTDB_TemplateDetails etp;
-  char *pos_key = NULL; // FIXME: fetch from DB!
-  enum TALER_MerchantConfirmationAlgorithm pos_algorithm = TALER_MCA_NONE; // 
FIXME fetch from DB!
   struct GNUNET_JSON_Specification spec[] = {
     GNUNET_JSON_spec_mark_optional (
       GNUNET_JSON_spec_string ("summary",
@@ -114,6 +112,7 @@ TMH_post_using_templates_ID (const struct 
TMH_RequestHandler *rh,
   }
 
   {
+    /* template */
     const char *tsummary;
     uint32_t min_age;
     struct GNUNET_TIME_Relative pay_duration;
@@ -238,8 +237,8 @@ TMH_post_using_templates_ID (const struct 
TMH_RequestHandler *rh,
     mret = TMH_private_post_orders_with_pos_secrets (NULL,   /* not even used 
*/
                                                      connection,
                                                      &fake_hc,
-                                                     pos_key,
-                                                     pos_algorithm);
+                                                     etp.pos_key,
+                                                     etp.pos_algorithm);
   }
   TALER_MERCHANTDB_template_details_free (&etp);
   json_decref (fake_body);
diff --git a/src/backend/taler-merchant-httpd_private-post-orders.c 
b/src/backend/taler-merchant-httpd_private-post-orders.c
index 66c698e8..c191f374 100644
--- a/src/backend/taler-merchant-httpd_private-post-orders.c
+++ b/src/backend/taler-merchant-httpd_private-post-orders.c
@@ -257,7 +257,9 @@ execute_transaction (struct TMH_HandlerContext *hc,
                      const struct InventoryProduct inventory_products[],
                      unsigned int uuids_length,
                      const struct GNUNET_Uuid uuids[],
-                     unsigned int *out_of_stock_index)
+                     unsigned int *out_of_stock_index,
+                     const char *pos_key,
+                     enum TALER_MerchantConfirmationAlgorithm pos_algorithm)
 {
   enum GNUNET_DB_QueryStatus qs;
   struct GNUNET_TIME_Timestamp timestamp;
@@ -278,8 +280,8 @@ execute_transaction (struct TMH_HandlerContext *hc,
                              pay_deadline,
                              claim_token,
                              order,  /* called 'contract terms' at database. */
-                             NULL,            // FIXME!
-                             TALER_MCA_NONE); // FIXME: use from 
TMH_private_post_orders_with_pos_secrets
+                             pos_key,
+                             pos_algorithm);
   if (qs <= 0)
   {
     /* qs == 0: probably instance does not exist (anymore) */
@@ -364,6 +366,8 @@ execute_transaction (struct TMH_HandlerContext *hc,
  * @param inventory_products array of products to add to @a order from our 
inventory
  * @param uuids_length length of the @a uuids array
  * @param uuids array of UUIDs used to reserve products from @a 
inventory_products
+ * @param pos_key encoded key for verification payment
+ * @param pos_algorithm  algorithm to compute the payment verification
  * @return MHD result code
  */
 static MHD_RESULT
@@ -375,7 +379,9 @@ execute_order (struct MHD_Connection *connection,
                unsigned int inventory_products_length,
                const struct InventoryProduct inventory_products[],
                unsigned int uuids_length,
-               const struct GNUNET_Uuid uuids[])
+               const struct GNUNET_Uuid uuids[],
+               const char *pos_key,
+               enum TALER_MerchantConfirmationAlgorithm pos_algorithm)
 {
   const struct TALER_MERCHANTDB_InstanceSettings *settings =
     &hc->instance->settings;
@@ -555,7 +561,9 @@ execute_order (struct MHD_Connection *connection,
                               inventory_products,
                               uuids_length,
                               uuids,
-                              &out_of_stock_index);
+                              &out_of_stock_index,
+                              pos_key,
+                              pos_algorithm);
     if (GNUNET_DB_STATUS_SOFT_ERROR != qs)
       break;
   }
@@ -693,6 +701,8 @@ execute_order (struct MHD_Connection *connection,
  * @param inventory_products array of products to add to @a order from our 
inventory
  * @param uuids_length length of the @a uuids array
  * @param uuids array of UUIDs used to reserve products from @a 
inventory_products
+ * @param pos_key encoded key for verification payment
+ * @param pos_algorithm  algorithm to compute the payment verification
  * @return MHD result code
  */
 static MHD_RESULT
@@ -705,7 +715,9 @@ patch_order (struct MHD_Connection *connection,
              unsigned int inventory_products_length,
              const struct InventoryProduct inventory_products[],
              unsigned int uuids_length,
-             const struct GNUNET_Uuid uuids[])
+             const struct GNUNET_Uuid uuids[],
+             const char *pos_key,
+             enum TALER_MerchantConfirmationAlgorithm pos_algorithm)
 {
   const struct TALER_MERCHANTDB_InstanceSettings *settings =
     &hc->instance->settings;
@@ -1205,7 +1217,9 @@ patch_order (struct MHD_Connection *connection,
                           inventory_products_length,
                           inventory_products,
                           uuids_length,
-                          uuids);
+                          uuids,
+                          pos_key,
+                          pos_algorithm);
     GNUNET_JSON_parse_free (spec);
     return mres;
   }
@@ -1228,6 +1242,8 @@ patch_order (struct MHD_Connection *connection,
  * @param inventory_products array of products to add to @a order from our 
inventory
  * @param uuids_length length of the @a uuids array
  * @param uuids array of UUIDs used to reserve products from @a 
inventory_products
+ * @param pos_key encoded key for verification payment
+ * @param pos_algorithm  algorithm to compute the payment verification
  * @return MHD result code
  */
 static MHD_RESULT
@@ -1241,7 +1257,9 @@ add_payment_details (struct MHD_Connection *connection,
                      unsigned int inventory_products_length,
                      const struct InventoryProduct inventory_products[],
                      unsigned int uuids_length,
-                     const struct GNUNET_Uuid uuids[])
+                     const struct GNUNET_Uuid uuids[],
+                     const char *pos_key,
+                     enum TALER_MerchantConfirmationAlgorithm pos_algorithm)
 {
   struct TMH_WireMethod *wm;
 
@@ -1281,7 +1299,9 @@ add_payment_details (struct MHD_Connection *connection,
                       inventory_products_length,
                       inventory_products,
                       uuids_length,
-                      uuids);
+                      uuids,
+                      pos_key,
+                      pos_algorithm);
 }
 
 
@@ -1301,6 +1321,8 @@ add_payment_details (struct MHD_Connection *connection,
  * @param inventory_products array of products to add to @a order from our 
inventory
  * @param uuids_length length of the @a uuids array
  * @param uuids array of UUIDs used to reserve products from @a 
inventory_products
+ * @param pos_key encoded key for verification payment
+ * @param pos_algorithm  algorithm to compute the payment verification
  * @return MHD result code
  */
 static MHD_RESULT
@@ -1314,7 +1336,9 @@ merge_inventory (struct MHD_Connection *connection,
                  unsigned int inventory_products_length,
                  const struct InventoryProduct inventory_products[],
                  unsigned int uuids_length,
-                 const struct GNUNET_Uuid uuids[])
+                 const struct GNUNET_Uuid uuids[],
+                 const char *pos_key,
+                 enum TALER_MerchantConfirmationAlgorithm pos_algorithm)
 {
   /**
    * inventory_products => instructions to add products to contract terms
@@ -1437,7 +1461,9 @@ merge_inventory (struct MHD_Connection *connection,
                               inventory_products_length,
                               inventory_products,
                               uuids_length,
-                              uuids);
+                              uuids,
+                              pos_key,
+                              pos_algorithm);
 }
 
 
@@ -1650,7 +1676,9 @@ TMH_private_post_orders_with_pos_secrets (
                            ips_len,
                            ips,
                            uuids_len,
-                           uuids);
+                           uuids,
+                           pos_key,
+                           pos_algorithm);
     GNUNET_array_grow (ips,
                        ips_len,
                        0);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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