gnunet-svn
[Top][All Lists]
Advanced

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

[taler-sync] branch master updated: fix FTBFS from GNUnet/exchange/merch


From: gnunet
Subject: [taler-sync] branch master updated: fix FTBFS from GNUnet/exchange/merchant API changes
Date: Sat, 18 Jul 2020 10:59:29 +0200

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

grothoff pushed a commit to branch master
in repository sync.

The following commit(s) were added to refs/heads/master by this push:
     new 62fde35  fix FTBFS from GNUnet/exchange/merchant API changes
62fde35 is described below

commit 62fde35881aa5e1b50e1b93f0c0b7390024f7244
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Jul 18 10:59:20 2020 +0200

    fix FTBFS from GNUnet/exchange/merchant API changes
---
 src/lib/sync_api_upload.c               |  2 +-
 src/lib/testing_api_cmd_backup_upload.c |  2 +-
 src/lib/testing_api_helpers.c           | 20 +++++-----
 src/sync/sync-httpd_backup_post.c       | 69 ++++++++++++++-------------------
 src/syncdb/test_sync_db.c               |  2 +-
 5 files changed, 41 insertions(+), 54 deletions(-)

diff --git a/src/lib/sync_api_upload.c b/src/lib/sync_api_upload.c
index a582be9..100d10c 100644
--- a/src/lib/sync_api_upload.c
+++ b/src/lib/sync_api_upload.c
@@ -446,7 +446,7 @@ SYNC_upload_cancel (struct SYNC_UploadOperation *uo)
     GNUNET_CURL_job_cancel (uo->job);
     uo->job = NULL;
   }
-  GNUNET_free_non_null (uo->pay_uri);
+  GNUNET_free (uo->pay_uri);
   GNUNET_free (uo->url);
   GNUNET_free (uo);
 }
diff --git a/src/lib/testing_api_cmd_backup_upload.c 
b/src/lib/testing_api_cmd_backup_upload.c
index f6ac30a..1b9f9a8 100644
--- a/src/lib/testing_api_cmd_backup_upload.c
+++ b/src/lib/testing_api_cmd_backup_upload.c
@@ -386,7 +386,7 @@ backup_upload_cleanup (void *cls,
     SYNC_upload_cancel (bus->uo);
     bus->uo = NULL;
   }
-  GNUNET_free_non_null (bus->payment_order_id);
+  GNUNET_free (bus->payment_order_id);
   GNUNET_free (bus);
 }
 
diff --git a/src/lib/testing_api_helpers.c b/src/lib/testing_api_helpers.c
index 7b6e6ad..a83c391 100644
--- a/src/lib/testing_api_helpers.c
+++ b/src/lib/testing_api_helpers.c
@@ -47,8 +47,7 @@ SYNC_TESTING_run_sync (const char *config_filename,
   char *wget_cmd;
 
   sync_proc
-    = GNUNET_OS_start_process (GNUNET_NO,
-                               GNUNET_OS_INHERIT_STD_ALL,
+    = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ALL,
                                NULL, NULL, NULL,
                                "sync-httpd",
                                "sync-httpd",
@@ -147,15 +146,14 @@ SYNC_TESTING_prepare_sync (const char *config_filename)
   }
 
   /* DB preparation */
-  if (NULL == (dbinit_proc = GNUNET_OS_start_process
-                               (GNUNET_NO,
-                               GNUNET_OS_INHERIT_STD_ALL,
-                               NULL, NULL, NULL,
-                               "sync-dbinit",
-                               "sync-dbinit",
-                               "-c", config_filename,
-                               "-r",
-                               NULL)))
+  if (NULL == (dbinit_proc = GNUNET_OS_start_process (
+                 GNUNET_OS_INHERIT_STD_ALL,
+                 NULL, NULL, NULL,
+                 "sync-dbinit",
+                 "sync-dbinit",
+                 "-c", config_filename,
+                 "-r",
+                 NULL)))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Failed to run sync-dbinit."
diff --git a/src/sync/sync-httpd_backup_post.c 
b/src/sync/sync-httpd_backup_post.c
index 0b189a1..a990792 100644
--- a/src/sync/sync-httpd_backup_post.c
+++ b/src/sync/sync-httpd_backup_post.c
@@ -95,12 +95,12 @@ struct BackupContext
   /**
    * Used while we are awaiting proposal creation.
    */
-  struct TALER_MERCHANT_ProposalOperation *po;
+  struct TALER_MERCHANT_PostOrdersOperation *po;
 
   /**
    * Used while we are waiting payment.
    */
-  struct TALER_MERCHANT_CheckPaymentOperation *cpo;
+  struct TALER_MERCHANT_OrderMerchantGetHandle *omgh;
 
   /**
    * HTTP response code to use on resume, if non-NULL.
@@ -168,13 +168,13 @@ SH_resume_all_bc ()
     MHD_resume_connection (bc->con);
     if (NULL != bc->po)
     {
-      TALER_MERCHANT_proposal_cancel (bc->po);
+      TALER_MERCHANT_orders_post_cancel (bc->po);
       bc->po = NULL;
     }
-    if (NULL != bc->cpo)
+    if (NULL != bc->omgh)
     {
-      TALER_MERCHANT_check_payment_cancel (bc->cpo);
-      bc->cpo = NULL;
+      TALER_MERCHANT_merchant_order_get_cancel (bc->omgh);
+      bc->omgh = NULL;
     }
   }
 }
@@ -191,13 +191,13 @@ cleanup_ctx (struct TM_HandlerContext *hc)
   struct BackupContext *bc = (struct BackupContext *) hc;
 
   if (NULL != bc->po)
-    TALER_MERCHANT_proposal_cancel (bc->po);
+    TALER_MERCHANT_orders_post_cancel (bc->po);
   if (NULL != bc->hash_ctx)
     GNUNET_CRYPTO_hash_context_abort (bc->hash_ctx);
   if (NULL != bc->resp)
     MHD_destroy_response (bc->resp);
-  GNUNET_free_non_null (bc->existing_order_id);
-  GNUNET_free_non_null (bc->upload);
+  GNUNET_free (bc->existing_order_id);
+  GNUNET_free (bc->upload);
   GNUNET_free (bc);
 }
 
@@ -337,7 +337,7 @@ ongoing_payment_cb (void *cls,
   if ( (NULL == bc->existing_order_id) ||
        (bc->existing_order_timestamp.abs_value_us < timestamp.abs_value_us) )
   {
-    GNUNET_free_non_null (bc->existing_order_id);
+    GNUNET_free (bc->existing_order_id);
     bc->existing_order_id = GNUNET_strdup (order_id);
     bc->existing_order_timestamp = timestamp;
   }
@@ -349,39 +349,26 @@ ongoing_payment_cb (void *cls,
  *
  * @param cls our `struct BackupContext`
  * @param hr HTTP response details
- * @param paid #GNUNET_YES if the payment is settled, #GNUNET_NO if not
- *        settled, $GNUNET_SYSERR on error
- *        (note that refunded payments are returned as paid!)
- * @param refunded #GNUNET_YES if there is at least on refund on this payment,
- *        #GNUNET_NO if refunded, #GNUNET_SYSERR or error
- * @param refunded_amount amount that was refunded, NULL if there
- *        was no refund
- * @param taler_pay_uri the URI that instructs the wallets to process
- *                      the payment
+ * @param osr order status
  */
 static void
 check_payment_cb (void *cls,
                   const struct TALER_MERCHANT_HttpResponse *hr,
-                  int paid,
-                  int refunded,
-                  struct TALER_Amount *refund_amount,
-                  const char *taler_pay_uri)
+                  const struct TALER_MERCHANT_OrderStatusResponse *osr)
 {
   struct BackupContext *bc = cls;
 
   /* refunds are not supported, verify */
-  bc->cpo = NULL;
+  bc->omgh = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "Payment status checked: %s\n",
-              paid ? "paid" : "unpaid");
+              osr->paid ? "paid" : "unpaid");
   GNUNET_CONTAINER_DLL_remove (bc_head,
                                bc_tail,
                                bc);
   MHD_resume_connection (bc->con);
   SH_trigger_daemon ();
-  GNUNET_break ( (GNUNET_NO == refunded) &&
-                 (NULL == refund_amount) );
-  if (paid)
+  if (osr->paid)
   {
     enum SYNC_DB_QueryStatus qs;
 
@@ -435,13 +422,14 @@ await_payment (struct BackupContext *bc,
                                bc);
   MHD_suspend_connection (bc->con);
   bc->order_id = order_id;
-  bc->cpo = TALER_MERCHANT_check_payment (SH_ctx,
-                                          SH_backend_url,
-                                          order_id,
-                                          NULL /* our payments are NOT 
session-bound */,
-                                          timeout,
-                                          &check_payment_cb,
-                                          bc);
+  bc->omgh = TALER_MERCHANT_merchant_order_get (SH_ctx,
+                                                SH_backend_url,
+                                                order_id,
+                                                NULL /* our payments are NOT 
session-bound */,
+                                                false,
+                                                timeout,
+                                                &check_payment_cb,
+                                                bc);
   SH_trigger_curl ();
 }
 
@@ -503,11 +491,12 @@ begin_payment (struct BackupContext *bc,
                      "amount", TALER_JSON_from_amount (&SH_annual_fee),
                      "summary", "annual fee for sync service",
                      "fulfillment_url", SH_fulfillment_url);
-  bc->po = TALER_MERCHANT_order_put (SH_ctx,
-                                     SH_backend_url,
-                                     order,
-                                     &proposal_cb,
-                                     bc);
+  bc->po = TALER_MERCHANT_orders_post (SH_ctx,
+                                       SH_backend_url,
+                                       order,
+                                       GNUNET_TIME_UNIT_ZERO,
+                                       &proposal_cb,
+                                       bc);
   SH_trigger_curl ();
   json_decref (order);
   return MHD_YES;
diff --git a/src/syncdb/test_sync_db.c b/src/syncdb/test_sync_db.c
index c690189..51ef58b 100644
--- a/src/syncdb/test_sync_db.c
+++ b/src/syncdb/test_sync_db.c
@@ -244,7 +244,7 @@ run (void *cls)
 
   result = 0;
 drop:
-  GNUNET_free_non_null (b);
+  GNUNET_free (b);
   GNUNET_break (GNUNET_OK ==
                 plugin->drop_tables (plugin->cls));
   SYNC_DB_plugin_unload (plugin);

-- 
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]