gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: -remove _tuple suffix


From: gnunet
Subject: [taler-merchant] branch master updated: -remove _tuple suffix
Date: Sun, 30 Jul 2023 12:32:47 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new b5cd1d11 -remove _tuple suffix
b5cd1d11 is described below

commit b5cd1d1102e0c3e88604d5ba9d39090ddebc8b58
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Jul 30 12:32:42 2023 +0200

    -remove _tuple suffix
---
 contrib/uncrustify.cfg                             |    4 +-
 ...er-merchant-httpd_private-delete-templates-ID.c |    8 +-
 ...er-merchant-httpd_private-delete-templates-ID.h |    4 +-
 ...taler-merchant-httpd_private-get-templates-ID.h |    4 +-
 .../taler-merchant-httpd_private-get-templates.h   |    4 +-
 ...ler-merchant-httpd_private-patch-templates-ID.h |    4 +-
 ...aler-merchant-httpd_private-patch-webhooks-ID.c |    4 +-
 .../taler-merchant-httpd_private-post-templates.h  |    4 +-
 src/backend/taler-merchant-webhook.c               |  130 +-
 src/backenddb/merchantdb_helper.c                  |    3 +-
 src/backenddb/pg_account_kyc_get_status.c          |    1 +
 src/backenddb/pg_account_kyc_set_status.h          |    6 +-
 src/backenddb/pg_activate_reserve.c                |    4 +-
 src/backenddb/pg_authorize_reward.c                |    8 +-
 src/backenddb/pg_helper.h                          |    4 +-
 src/backenddb/pg_increase_refund.c                 |    4 +-
 src/backenddb/pg_insert_deposit.c                  |   16 +-
 src/backenddb/pg_insert_deposit.h                  |    3 +-
 src/backenddb/pg_insert_deposit_to_transfer.c      |    4 +-
 src/backenddb/pg_insert_exchange_signkey.h         |    6 +-
 src/backenddb/pg_insert_instance.c                 |    8 +-
 src/backenddb/pg_insert_instance.h                 |    3 +-
 src/backenddb/pg_insert_pickup.c                   |   12 +-
 src/backenddb/pg_insert_product.c                  |    4 +-
 src/backenddb/pg_insert_reserve.c                  |    4 +-
 src/backenddb/pg_insert_transfer.c                 |    4 +-
 src/backenddb/pg_insert_transfer_details.c         |   16 +-
 src/backenddb/pg_lookup_deposits.h                 |    3 +-
 src/backenddb/pg_lookup_orders.c                   | 1520 ++++++++++----------
 src/backenddb/pg_lookup_products.c                 |    1 +
 src/backenddb/pg_lookup_refunds.h                  |    3 +-
 src/backenddb/pg_mark_contract_paid.h              |    3 +-
 .../pg_set_transfer_status_to_confirmed.c          |    4 +-
 src/backenddb/pg_store_wire_fee_by_exchange.c      |    8 +-
 src/backenddb/pg_update_instance.c                 |    8 +-
 src/backenddb/pg_update_instance_auth.h            |    3 +-
 src/backenddb/pg_update_product.c                  |    4 +-
 src/backenddb/test_merchantdb.c                    |  222 +--
 src/include/taler_merchant_testing_lib.h           |  105 +-
 src/lib/merchant_api_delete_account.c              |    4 +-
 src/lib/merchant_api_delete_template.c             |    4 +-
 src/lib/merchant_api_get_rewards.c                 |   36 +-
 src/lib/merchant_api_merchant_get_reward.c         |   19 +-
 src/lib/merchant_api_post_account.c                |   26 +-
 src/lib/merchant_api_post_using_templates.c        |    6 +-
 src/lib/merchant_api_reward_authorize.c            |   17 +-
 src/lib/merchant_api_reward_pickup.c               |   15 +-
 src/lib/merchant_api_reward_pickup2.c              |    9 +-
 src/lib/merchant_api_wallet_get_reward.c           |   13 +-
 src/testing/testing_api_cmd_config.c               |    3 +-
 src/testing/testing_api_cmd_delete_instance.c      |   22 +-
 src/testing/testing_api_cmd_delete_order.c         |   13 +-
 src/testing/testing_api_cmd_delete_product.c       |   11 +-
 src/testing/testing_api_cmd_delete_reserve.c       |   22 +-
 src/testing/testing_api_cmd_delete_template.c      |   25 +-
 src/testing/testing_api_cmd_delete_transfer.c      |   11 +-
 src/testing/testing_api_cmd_delete_webhook.c       |   11 +-
 src/testing/testing_api_cmd_get_reserves.c         |   15 +-
 src/testing/testing_api_cmd_kyc_get.c              |   20 +-
 src/testing/testing_api_cmd_post_account.c         |   11 +-
 src/testing/testing_api_cmd_post_reserves.c        |   15 +-
 src/testing/testing_api_cmd_tme.c                  |   12 +-
 62 files changed, 1267 insertions(+), 1233 deletions(-)

diff --git a/contrib/uncrustify.cfg b/contrib/uncrustify.cfg
index 00cf2281..af2d8e69 100644
--- a/contrib/uncrustify.cfg
+++ b/contrib/uncrustify.cfg
@@ -28,7 +28,7 @@ ls_code_width=true
 pos_arith=lead
 
 # Fully parenthesize boolean exprs
-mod_full_paren_if_bool=true
+mod_full_paren_if_bool=false
 
 # Braces should be on their own line
 nl_fdef_brace=add
@@ -49,8 +49,6 @@ nl_assign_brace=remove
 
 # No extra newlines that cause noisy diffs
 nl_start_of_file=remove
-nl_before_func_body_proto = 0
-nl_before_func_body_def = 0
 nl_after_func_proto = 2
 nl_after_func_body = 3
 # If there's no new line, it's not a text file!
diff --git a/src/backend/taler-merchant-httpd_private-delete-templates-ID.c 
b/src/backend/taler-merchant-httpd_private-delete-templates-ID.c
index 0c2570fa..9602b652 100644
--- a/src/backend/taler-merchant-httpd_private-delete-templates-ID.c
+++ b/src/backend/taler-merchant-httpd_private-delete-templates-ID.c
@@ -33,8 +33,8 @@
  */
 MHD_RESULT
 TMH_private_delete_templates_ID (const struct TMH_RequestHandler *rh,
-                                struct MHD_Connection *connection,
-                                struct TMH_HandlerContext *hc)
+                                 struct MHD_Connection *connection,
+                                 struct TMH_HandlerContext *hc)
 {
   struct TMH_MerchantInstance *mi = hc->instance;
   enum GNUNET_DB_QueryStatus qs;
@@ -43,8 +43,8 @@ TMH_private_delete_templates_ID (const struct 
TMH_RequestHandler *rh,
   GNUNET_assert (NULL != mi);
   GNUNET_assert (NULL != hc->infix);
   qs = TMH_db->delete_template (TMH_db->cls,
-                               mi->settings.id,
-                               hc->infix);
+                                mi->settings.id,
+                                hc->infix);
   switch (qs)
   {
   case GNUNET_DB_STATUS_HARD_ERROR:
diff --git a/src/backend/taler-merchant-httpd_private-delete-templates-ID.h 
b/src/backend/taler-merchant-httpd_private-delete-templates-ID.h
index aa7adc4b..21fb46ac 100644
--- a/src/backend/taler-merchant-httpd_private-delete-templates-ID.h
+++ b/src/backend/taler-merchant-httpd_private-delete-templates-ID.h
@@ -34,8 +34,8 @@
  */
 MHD_RESULT
 TMH_private_delete_templates_ID (const struct TMH_RequestHandler *rh,
-                                struct MHD_Connection *connection,
-                                struct TMH_HandlerContext *hc);
+                                 struct MHD_Connection *connection,
+                                 struct TMH_HandlerContext *hc);
 
 /* end of taler-merchant-httpd_private-delete-templates-ID.h */
 #endif
diff --git a/src/backend/taler-merchant-httpd_private-get-templates-ID.h 
b/src/backend/taler-merchant-httpd_private-get-templates-ID.h
index cf5e4d83..384ab818 100644
--- a/src/backend/taler-merchant-httpd_private-get-templates-ID.h
+++ b/src/backend/taler-merchant-httpd_private-get-templates-ID.h
@@ -34,8 +34,8 @@
  */
 MHD_RESULT
 TMH_private_get_templates_ID (const struct TMH_RequestHandler *rh,
-                             struct MHD_Connection *connection,
-                             struct TMH_HandlerContext *hc);
+                              struct MHD_Connection *connection,
+                              struct TMH_HandlerContext *hc);
 
 /* end of taler-merchant-httpd_private-get-templates-ID.h */
 #endif
diff --git a/src/backend/taler-merchant-httpd_private-get-templates.h 
b/src/backend/taler-merchant-httpd_private-get-templates.h
index b5b5f025..d791bba7 100644
--- a/src/backend/taler-merchant-httpd_private-get-templates.h
+++ b/src/backend/taler-merchant-httpd_private-get-templates.h
@@ -34,8 +34,8 @@
  */
 MHD_RESULT
 TMH_private_get_templates (const struct TMH_RequestHandler *rh,
-                          struct MHD_Connection *connection,
-                          struct TMH_HandlerContext *hc);
+                           struct MHD_Connection *connection,
+                           struct TMH_HandlerContext *hc);
 
 /* end of taler-merchant-httpd_private-get-templates.h */
 #endif
diff --git a/src/backend/taler-merchant-httpd_private-patch-templates-ID.h 
b/src/backend/taler-merchant-httpd_private-patch-templates-ID.h
index 29cf4830..63ec50cb 100644
--- a/src/backend/taler-merchant-httpd_private-patch-templates-ID.h
+++ b/src/backend/taler-merchant-httpd_private-patch-templates-ID.h
@@ -37,7 +37,7 @@
  */
 MHD_RESULT
 TMH_private_patch_templates_ID (const struct TMH_RequestHandler *rh,
-                               struct MHD_Connection *connection,
-                               struct TMH_HandlerContext *hc);
+                                struct MHD_Connection *connection,
+                                struct TMH_HandlerContext *hc);
 
 #endif
diff --git a/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c 
b/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c
index 18f946f0..5b73b16e 100644
--- a/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c
+++ b/src/backend/taler-merchant-httpd_private-patch-webhooks-ID.c
@@ -119,11 +119,11 @@ TMH_private_patch_webhooks_ID (const struct 
TMH_RequestHandler *rh,
     GNUNET_JSON_spec_mark_optional (
       GNUNET_JSON_spec_string ("header_template",
                                (const char **) &wb.header_template),
-    NULL),
+      NULL),
     GNUNET_JSON_spec_mark_optional (
       GNUNET_JSON_spec_string ("body_template",
                                (const char **) &wb.body_template),
-    NULL),
+      NULL),
     GNUNET_JSON_spec_end ()
   };
 
diff --git a/src/backend/taler-merchant-httpd_private-post-templates.h 
b/src/backend/taler-merchant-httpd_private-post-templates.h
index c3a7f741..35e37625 100644
--- a/src/backend/taler-merchant-httpd_private-post-templates.h
+++ b/src/backend/taler-merchant-httpd_private-post-templates.h
@@ -37,7 +37,7 @@
  */
 MHD_RESULT
 TMH_private_post_templates (const struct TMH_RequestHandler *rh,
-                           struct MHD_Connection *connection,
-                           struct TMH_HandlerContext *hc);
+                            struct MHD_Connection *connection,
+                            struct TMH_HandlerContext *hc);
 
 #endif
diff --git a/src/backend/taler-merchant-webhook.c 
b/src/backend/taler-merchant-webhook.c
index d25965cc..721153fa 100644
--- a/src/backend/taler-merchant-webhook.c
+++ b/src/backend/taler-merchant-webhook.c
@@ -179,28 +179,28 @@ handle_webhook_response (void *cls,
                                             w->webhook_pending_serial);
     GNUNET_free (w);
     switch (qs)
-      {
-      case GNUNET_DB_STATUS_HARD_ERROR:
-      case GNUNET_DB_STATUS_SOFT_ERROR:
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Failed!\n");
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+    {
+    case GNUNET_DB_STATUS_HARD_ERROR:
+    case GNUNET_DB_STATUS_SOFT_ERROR:
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Failed!\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Delete returned: %d\n",
+                  qs);
+      global_ret = EXIT_FAILURE;
+      GNUNET_SCHEDULER_shutdown ();
+      return;
+    case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Delete returned: %d\n",
+                  qs);
+      return;
+    case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Delete returned: %d\n",
                   qs);
-        global_ret = EXIT_FAILURE;
-        GNUNET_SCHEDULER_shutdown ();
-        return;
-      case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                    "Delete returned: %d\n",
-                    qs);
-        return;
-      case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                    "Delete returned: %d\n",
-                    qs);
-        return;
-        }
+      return;
+    }
     GNUNET_assert (0);
   }
 
@@ -208,50 +208,51 @@ handle_webhook_response (void *cls,
     struct GNUNET_TIME_Relative next_attempt;
     enum GNUNET_DB_QueryStatus qs;
     switch (response_code)
-      {
-      case MHD_HTTP_BAD_REQUEST:
-        next_attempt = GNUNET_TIME_UNIT_FOREVER_REL; // never try again
-        break;
-      case MHD_HTTP_INTERNAL_SERVER_ERROR:
-        next_attempt = GNUNET_TIME_UNIT_MINUTES;
-        break;
-      case MHD_HTTP_FORBIDDEN:
-        next_attempt = GNUNET_TIME_UNIT_MINUTES;
-        break;
-      default:
-        next_attempt = GNUNET_TIME_UNIT_HOURS;
-        break;
-      }
+    {
+    case MHD_HTTP_BAD_REQUEST:
+      next_attempt = GNUNET_TIME_UNIT_FOREVER_REL;   // never try again
+      break;
+    case MHD_HTTP_INTERNAL_SERVER_ERROR:
+      next_attempt = GNUNET_TIME_UNIT_MINUTES;
+      break;
+    case MHD_HTTP_FORBIDDEN:
+      next_attempt = GNUNET_TIME_UNIT_MINUTES;
+      break;
+    default:
+      next_attempt = GNUNET_TIME_UNIT_HOURS;
+      break;
+    }
     qs = db_plugin->update_pending_webhook (db_plugin->cls,
                                             w->webhook_pending_serial,
-                                            GNUNET_TIME_relative_to_absolute 
(next_attempt));
+                                            GNUNET_TIME_relative_to_absolute (
+                                              next_attempt));
     GNUNET_free (w);
     switch (qs)
-      {
-      case GNUNET_DB_STATUS_HARD_ERROR:
-      case GNUNET_DB_STATUS_SOFT_ERROR:
-        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "Failed!\n");
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+    {
+    case GNUNET_DB_STATUS_HARD_ERROR:
+    case GNUNET_DB_STATUS_SOFT_ERROR:
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Failed!\n");
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                   "Next in %s Rval: %d\n",
                   GNUNET_TIME_relative2s (next_attempt, true),
                   qs);
-        global_ret = EXIT_FAILURE;
-        GNUNET_SCHEDULER_shutdown ();
-        return;
-      case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                    "Next in %s Rval: %d\n",
-                    GNUNET_TIME_relative2s (next_attempt, true),
-                    qs);
-        return;
-      case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
-        GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                    "Next in %s Rval: %d\n",
-                    GNUNET_TIME_relative2s (next_attempt, true),
-                    qs);
-        return;
-      }
+      global_ret = EXIT_FAILURE;
+      GNUNET_SCHEDULER_shutdown ();
+      return;
+    case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Next in %s Rval: %d\n",
+                  GNUNET_TIME_relative2s (next_attempt, true),
+                  qs);
+      return;
+    case GNUNET_DB_STATUS_SUCCESS_NO_RESULTS:
+      GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+                  "Next in %s Rval: %d\n",
+                  GNUNET_TIME_relative2s (next_attempt, true),
+                  qs);
+      return;
+    }
     GNUNET_assert (0);
   }
 }
@@ -322,11 +323,11 @@ pending_webhooks_cb (void *cls,
     for (const char *tok = strtok (header_copy, "\n");
          NULL != tok;
          tok = strtok (NULL, "\n"))
-      {
-        // extract all Key: value from 'header_copy'!
-        job_headers = curl_slist_append (job_headers,
-                                         tok);
-      }
+    {
+      // extract all Key: value from 'header_copy'!
+      job_headers = curl_slist_append (job_headers,
+                                       tok);
+    }
     GNUNET_free (header_copy);
     GNUNET_assert (CURLE_OK ==
                    curl_easy_setopt (eh,
@@ -423,8 +424,6 @@ future_webhook_cb (void *cls,
 }
 
 
-
-
 static void
 select_work (void *cls)
 {
@@ -455,7 +454,8 @@ select_work (void *cls)
     qs = db_plugin->lookup_future_webhook (db_plugin->cls,
                                            &future_webhook_cb,
                                            NULL);
-    switch (qs) {
+    switch (qs)
+    {
     case GNUNET_DB_STATUS_HARD_ERROR:
     case GNUNET_DB_STATUS_SOFT_ERROR:
       GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/backenddb/merchantdb_helper.c 
b/src/backenddb/merchantdb_helper.c
index dc59572c..ee52cccc 100644
--- a/src/backenddb/merchantdb_helper.c
+++ b/src/backenddb/merchantdb_helper.c
@@ -37,7 +37,6 @@ TALER_MERCHANTDB_product_details_free (
 }
 
 
-
 void
 TALER_MERCHANTDB_template_details_free (
   struct TALER_MERCHANTDB_TemplateDetails *tp)
@@ -59,6 +58,7 @@ TALER_MERCHANTDB_webhook_details_free (
   GNUNET_free (wb->body_template);
 }
 
+
 void
 TALER_MERCHANTDB_pending_webhook_details_free (
   struct TALER_MERCHANTDB_PendingWebhookDetails *pwb)
@@ -70,5 +70,4 @@ TALER_MERCHANTDB_pending_webhook_details_free (
 }
 
 
-
 /* end of merchantdb_helper.c */
diff --git a/src/backenddb/pg_account_kyc_get_status.c 
b/src/backenddb/pg_account_kyc_get_status.c
index 8fd79945..1c7c5792 100644
--- a/src/backenddb/pg_account_kyc_get_status.c
+++ b/src/backenddb/pg_account_kyc_get_status.c
@@ -140,6 +140,7 @@ kyc_status_cb (void *cls,
   }
 }
 
+
 enum GNUNET_DB_QueryStatus
 TMH_PG_account_kyc_get_status (void *cls,
                                const char *merchant_id,
diff --git a/src/backenddb/pg_account_kyc_set_status.h 
b/src/backenddb/pg_account_kyc_set_status.h
index f8a8d96b..c9869242 100644
--- a/src/backenddb/pg_account_kyc_set_status.h
+++ b/src/backenddb/pg_account_kyc_set_status.h
@@ -46,8 +46,10 @@ TMH_PG_account_kyc_set_status (void *cls,
                                const struct TALER_MerchantWireHashP *h_wire,
                                const char *exchange_url,
                                uint64_t exchange_kyc_serial,
-                               const struct TALER_ExchangeSignatureP 
*exchange_sig,
-                               const struct TALER_ExchangePublicKeyP 
*exchange_pub,
+                               const struct
+                               TALER_ExchangeSignatureP *exchange_sig,
+                               const struct
+                               TALER_ExchangePublicKeyP *exchange_pub,
                                struct GNUNET_TIME_Timestamp timestamp,
                                bool kyc_ok,
                                enum TALER_AmlDecisionState aml_decision);
diff --git a/src/backenddb/pg_activate_reserve.c 
b/src/backenddb/pg_activate_reserve.c
index 14a945d5..fbdca791 100644
--- a/src/backenddb/pg_activate_reserve.c
+++ b/src/backenddb/pg_activate_reserve.c
@@ -36,8 +36,8 @@ TMH_PG_activate_reserve (void *cls,
   struct GNUNET_PQ_QueryParam params[] = {
     GNUNET_PQ_query_param_string (instance_id),
     GNUNET_PQ_query_param_auto_from_type (reserve_pub),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       initial_exchange_balance),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 initial_exchange_balance),
     GNUNET_PQ_query_param_end
   };
 
diff --git a/src/backenddb/pg_authorize_reward.c 
b/src/backenddb/pg_authorize_reward.c
index 771796e3..29cf6c5f 100644
--- a/src/backenddb/pg_authorize_reward.c
+++ b/src/backenddb/pg_authorize_reward.c
@@ -358,8 +358,8 @@ RETRY:
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_string (instance_id),
       GNUNET_PQ_query_param_auto_from_type (reserve_pubp),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         &rewards_committed),
+      TALER_PQ_query_param_amount (pg->conn,
+                                   &rewards_committed),
       GNUNET_PQ_query_param_end
     };
 
@@ -389,8 +389,8 @@ RETRY:
       GNUNET_PQ_query_param_string (justification),
       GNUNET_PQ_query_param_string (next_url),
       GNUNET_PQ_query_param_timestamp (expiration),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         amount),
+      TALER_PQ_query_param_amount (pg->conn,
+                                   amount),
       GNUNET_PQ_query_param_end
     };
 
diff --git a/src/backenddb/pg_helper.h b/src/backenddb/pg_helper.h
index 83fede8f..2de99c69 100644
--- a/src/backenddb/pg_helper.h
+++ b/src/backenddb/pg_helper.h
@@ -103,7 +103,7 @@ struct PostgresClosure
  * @param[out] amountp pointer to amount to set
  */
 #define TALER_PQ_RESULT_SPEC_AMOUNT(field, \
-                                    amountp) TALER_PQ_result_spec_amount_tuple 
( \
+                                    amountp) TALER_PQ_result_spec_amount ( \
     field,pg->currency,amountp)
 
 
@@ -116,7 +116,7 @@ struct PostgresClosure
  */
 #define TALER_PQ_RESULT_SPEC_AMOUNT_NBO(field,                          \
                                         amountp) \
-  TALER_PQ_result_spec_amount_tuple_nbo ( \
+  TALER_PQ_result_spec_amount_nbo ( \
     field,pg->currency,amountp)
 
 
diff --git a/src/backenddb/pg_increase_refund.c 
b/src/backenddb/pg_increase_refund.c
index 3b0842d6..e003512e 100644
--- a/src/backenddb/pg_increase_refund.c
+++ b/src/backenddb/pg_increase_refund.c
@@ -364,8 +364,8 @@ process_deposits_for_refund_cb (
         GNUNET_PQ_query_param_timestamp (&now),
         GNUNET_PQ_query_param_auto_from_type (&rcd[i].coin_pub),
         GNUNET_PQ_query_param_string (ctx->reason),
-        TALER_PQ_query_param_amount_tuple (pg->conn,
-                                           increment),
+        TALER_PQ_query_param_amount (pg->conn,
+                                     increment),
         GNUNET_PQ_query_param_end
       };
 
diff --git a/src/backenddb/pg_insert_deposit.c 
b/src/backenddb/pg_insert_deposit.c
index 2c1d1dd4..3b85dcf6 100644
--- a/src/backenddb/pg_insert_deposit.c
+++ b/src/backenddb/pg_insert_deposit.c
@@ -50,14 +50,14 @@ TMH_PG_insert_deposit (
     GNUNET_PQ_query_param_timestamp (&deposit_timestamp), /* $3 */
     GNUNET_PQ_query_param_auto_from_type (coin_pub),
     GNUNET_PQ_query_param_string (exchange_url),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       amount_with_fee), /* $6 */
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       deposit_fee),  /* $7 */
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       refund_fee), /* $8 */
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       wire_fee),  /* $9 */
+    TALER_PQ_query_param_amount (pg->conn,
+                                 amount_with_fee),       /* $6 */
+    TALER_PQ_query_param_amount (pg->conn,
+                                 deposit_fee),        /* $7 */
+    TALER_PQ_query_param_amount (pg->conn,
+                                 refund_fee),       /* $8 */
+    TALER_PQ_query_param_amount (pg->conn,
+                                 wire_fee),        /* $9 */
     GNUNET_PQ_query_param_auto_from_type (h_wire), /* $10 */
     GNUNET_PQ_query_param_auto_from_type (exchange_sig), /* $11 */
     GNUNET_PQ_query_param_auto_from_type (exchange_pub), /* $12 */
diff --git a/src/backenddb/pg_insert_deposit.h 
b/src/backenddb/pg_insert_deposit.h
index 49d783aa..999d9367 100644
--- a/src/backenddb/pg_insert_deposit.h
+++ b/src/backenddb/pg_insert_deposit.h
@@ -47,7 +47,8 @@ enum GNUNET_DB_QueryStatus
 TMH_PG_insert_deposit (void *cls,
                        const char *instance_id,
                        struct GNUNET_TIME_Timestamp deposit_timestamp,
-                       const struct TALER_PrivateContractHashP 
*h_contract_terms,
+                       const struct
+                       TALER_PrivateContractHashP *h_contract_terms,
                        const struct TALER_CoinSpendPublicKeyP *coin_pub,
                        const char *exchange_url,
                        const struct TALER_Amount *amount_with_fee,
diff --git a/src/backenddb/pg_insert_deposit_to_transfer.c 
b/src/backenddb/pg_insert_deposit_to_transfer.c
index 718d78fa..b79dd37c 100644
--- a/src/backenddb/pg_insert_deposit_to_transfer.c
+++ b/src/backenddb/pg_insert_deposit_to_transfer.c
@@ -35,8 +35,8 @@ TMH_PG_insert_deposit_to_transfer (
   struct PostgresClosure *pg = cls;
   struct GNUNET_PQ_QueryParam params[] = {
     GNUNET_PQ_query_param_uint64 (&deposit_serial),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &dd->coin_contribution),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &dd->coin_contribution),
     GNUNET_PQ_query_param_timestamp (&dd->execution_time),
     GNUNET_PQ_query_param_auto_from_type (&dd->exchange_sig),
     GNUNET_PQ_query_param_auto_from_type (&dd->exchange_pub),
diff --git a/src/backenddb/pg_insert_exchange_signkey.h 
b/src/backenddb/pg_insert_exchange_signkey.h
index 78f84846..47c7b996 100644
--- a/src/backenddb/pg_insert_exchange_signkey.h
+++ b/src/backenddb/pg_insert_exchange_signkey.h
@@ -39,10 +39,12 @@
 enum GNUNET_DB_QueryStatus
 TMH_PG_insert_exchange_signkey (void *cls,
                                 const struct TALER_MasterPublicKeyP 
*master_pub,
-                                const struct TALER_ExchangePublicKeyP 
*exchange_pub,
+                                const struct
+                                TALER_ExchangePublicKeyP *exchange_pub,
                                 struct GNUNET_TIME_Timestamp start_date,
                                 struct GNUNET_TIME_Timestamp expire_date,
                                 struct GNUNET_TIME_Timestamp end_date,
-                                const struct TALER_MasterSignatureP 
*master_sig);
+                                const struct
+                                TALER_MasterSignatureP *master_sig);
 
 #endif
diff --git a/src/backenddb/pg_insert_instance.c 
b/src/backenddb/pg_insert_instance.c
index 82344ff4..8f6fcc50 100644
--- a/src/backenddb/pg_insert_instance.c
+++ b/src/backenddb/pg_insert_instance.c
@@ -45,10 +45,10 @@ TMH_PG_insert_instance (
     GNUNET_PQ_query_param_uint32 (&ut32),
     TALER_PQ_query_param_json (is->address),
     TALER_PQ_query_param_json (is->jurisdiction),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &is->default_max_deposit_fee),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &is->default_max_wire_fee),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &is->default_max_deposit_fee),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &is->default_max_wire_fee),
     GNUNET_PQ_query_param_uint32 (&is->default_wire_fee_amortization),
     GNUNET_PQ_query_param_relative_time (
       &is->default_wire_transfer_delay),
diff --git a/src/backenddb/pg_insert_instance.h 
b/src/backenddb/pg_insert_instance.h
index 5b347363..27ba8581 100644
--- a/src/backenddb/pg_insert_instance.h
+++ b/src/backenddb/pg_insert_instance.h
@@ -40,6 +40,7 @@ TMH_PG_insert_instance (void *cls,
                         const struct TALER_MerchantPublicKeyP *merchant_pub,
                         const struct TALER_MerchantPrivateKeyP *merchant_priv,
                         const struct TALER_MERCHANTDB_InstanceSettings *is,
-                        const struct TALER_MERCHANTDB_InstanceAuthSettings 
*ias);
+                        const struct
+                        TALER_MERCHANTDB_InstanceAuthSettings *ias);
 
 #endif
diff --git a/src/backenddb/pg_insert_pickup.c b/src/backenddb/pg_insert_pickup.c
index 5f1f91fa..281d4c19 100644
--- a/src/backenddb/pg_insert_pickup.c
+++ b/src/backenddb/pg_insert_pickup.c
@@ -83,8 +83,8 @@ TMH_PG_insert_pickup (
       GNUNET_PQ_query_param_string (instance_id),
       GNUNET_PQ_query_param_auto_from_type (reward_id),
       GNUNET_PQ_query_param_auto_from_type (pickup_id),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         total_requested),
+      TALER_PQ_query_param_amount (pg->conn,
+                                   total_requested),
       GNUNET_PQ_query_param_end
     };
 
@@ -98,8 +98,8 @@ TMH_PG_insert_pickup (
   {
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_auto_from_type (reward_id),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         total_picked_up),
+      TALER_PQ_query_param_amount (pg->conn,
+                                   total_picked_up),
       GNUNET_PQ_query_param_end
     };
 
@@ -146,8 +146,8 @@ TMH_PG_insert_pickup (
     {
       struct GNUNET_PQ_QueryParam params[] = {
         GNUNET_PQ_query_param_uint64 (&reserve_serial),
-        TALER_PQ_query_param_amount_tuple (pg->conn,
-                                           &reserve_picked_up),
+        TALER_PQ_query_param_amount (pg->conn,
+                                     &reserve_picked_up),
         GNUNET_PQ_query_param_end
       };
 
diff --git a/src/backenddb/pg_insert_product.c 
b/src/backenddb/pg_insert_product.c
index 3767accc..19096962 100644
--- a/src/backenddb/pg_insert_product.c
+++ b/src/backenddb/pg_insert_product.c
@@ -41,8 +41,8 @@ TMH_PG_insert_product (void *cls,
     GNUNET_PQ_query_param_string (pd->unit),
     GNUNET_PQ_query_param_string (pd->image),
     TALER_PQ_query_param_json (pd->taxes),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &pd->price),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &pd->price),
     GNUNET_PQ_query_param_uint64 (&pd->total_stock),
     TALER_PQ_query_param_json (pd->address),
     GNUNET_PQ_query_param_timestamp (&pd->next_restock),
diff --git a/src/backenddb/pg_insert_reserve.c 
b/src/backenddb/pg_insert_reserve.c
index bc73b747..c2da4e15 100644
--- a/src/backenddb/pg_insert_reserve.c
+++ b/src/backenddb/pg_insert_reserve.c
@@ -78,8 +78,8 @@ RETRY:
       GNUNET_PQ_query_param_auto_from_type (reserve_pub),
       GNUNET_PQ_query_param_timestamp (&now),
       GNUNET_PQ_query_param_timestamp (&expiration),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         initial_balance),
+      TALER_PQ_query_param_amount (pg->conn,
+                                   initial_balance),
       GNUNET_PQ_query_param_end
     };
 
diff --git a/src/backenddb/pg_insert_transfer.c 
b/src/backenddb/pg_insert_transfer.c
index 872cd1ff..3c1502e5 100644
--- a/src/backenddb/pg_insert_transfer.c
+++ b/src/backenddb/pg_insert_transfer.c
@@ -40,8 +40,8 @@ TMH_PG_insert_transfer (
   struct GNUNET_PQ_QueryParam params[] = {
     GNUNET_PQ_query_param_string (exchange_url),
     GNUNET_PQ_query_param_auto_from_type (wtid),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       credit_amount),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 credit_amount),
     GNUNET_PQ_query_param_string (payto_uri),
     GNUNET_PQ_query_param_bool (confirmed),
     GNUNET_PQ_query_param_string (instance_id),
diff --git a/src/backenddb/pg_insert_transfer_details.c 
b/src/backenddb/pg_insert_transfer_details.c
index d79dbe90..1b08733f 100644
--- a/src/backenddb/pg_insert_transfer_details.c
+++ b/src/backenddb/pg_insert_transfer_details.c
@@ -174,10 +174,10 @@ RETRY:
   {
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_uint64 (&credit_serial),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         &td->total_amount),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         &td->wire_fee),
+      TALER_PQ_query_param_amount (pg->conn,
+                                   &td->total_amount),
+      TALER_PQ_query_param_amount (pg->conn,
+                                   &td->wire_fee),
       GNUNET_PQ_query_param_timestamp (&td->execution_time),
       GNUNET_PQ_query_param_auto_from_type (&td->exchange_sig),
       GNUNET_PQ_query_param_auto_from_type (&td->exchange_pub),
@@ -218,10 +218,10 @@ RETRY:
     struct GNUNET_PQ_QueryParam params[] = {
       GNUNET_PQ_query_param_uint64 (&credit_serial),
       GNUNET_PQ_query_param_uint64 (&i64),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         &d->coin_value),
-      TALER_PQ_query_param_amount_tuple (pg->conn,
-                                         &d->coin_fee), /* deposit fee */
+      TALER_PQ_query_param_amount (pg->conn,
+                                   &d->coin_value),
+      TALER_PQ_query_param_amount (pg->conn,
+                                   &d->coin_fee),       /* deposit fee */
       GNUNET_PQ_query_param_auto_from_type (&d->coin_pub),
       GNUNET_PQ_query_param_auto_from_type (&d->h_contract_terms),
       GNUNET_PQ_query_param_string (instance_id),
diff --git a/src/backenddb/pg_lookup_deposits.h 
b/src/backenddb/pg_lookup_deposits.h
index 891a1093..33c7165a 100644
--- a/src/backenddb/pg_lookup_deposits.h
+++ b/src/backenddb/pg_lookup_deposits.h
@@ -39,7 +39,8 @@
 enum GNUNET_DB_QueryStatus
 TMH_PG_lookup_deposits (void *cls,
                         const char *instance_id,
-                        const struct TALER_PrivateContractHashP 
*h_contract_terms,
+                        const struct
+                        TALER_PrivateContractHashP *h_contract_terms,
                         TALER_MERCHANTDB_DepositsCallback cb,
                         void *cb_cls);
 
diff --git a/src/backenddb/pg_lookup_orders.c b/src/backenddb/pg_lookup_orders.c
index 437ca8ca..48f1514e 100644
--- a/src/backenddb/pg_lookup_orders.c
+++ b/src/backenddb/pg_lookup_orders.c
@@ -139,782 +139,782 @@ TMH_PG_lookup_orders (void *cls,
                    "_refunded",
                    (TALER_EXCHANGE_YNA_ALL == of->wired) ? "" : "_wired");
   PREPARE (pg,
-          "lookup_orders_inc",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2");
+           "lookup_orders_inc",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_inc_paid",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    BOOL($5) = paid"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2");
+           "lookup_orders_inc_paid",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    BOOL($5) = paid"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_inc_refunded",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    CAST($6 as BOOL) = (order_serial IN"
-          "     (SELECT order_serial "
-          "      FROM merchant_refunds))"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2");
+           "lookup_orders_inc_refunded",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    CAST($6 as BOOL) = (order_serial IN"
+           "     (SELECT order_serial "
+           "      FROM merchant_refunds))"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_inc_wired",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    BOOL($7) = wired"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2");
+           "lookup_orders_inc_wired",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    BOOL($7) = wired"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_inc_paid_refunded",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
-          "   AND"
-          "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    BOOL($5) = paid"
-          "   AND"
-          "    BOOL($6) = (order_serial IN"
-          "     (SELECT order_serial "
-          "      FROM merchant_refunds))"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2");
+           "lookup_orders_inc_paid_refunded",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
+           "   AND"
+           "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    BOOL($5) = paid"
+           "   AND"
+           "    BOOL($6) = (order_serial IN"
+           "     (SELECT order_serial "
+           "      FROM merchant_refunds))"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_inc_paid_wired",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
-          "   AND"
-          "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    BOOL($5) = paid"
-          "   AND"
-          "    BOOL($7) = wired"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2");
+           "lookup_orders_inc_paid_wired",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
+           "   AND"
+           "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    BOOL($5) = paid"
+           "   AND"
+           "    BOOL($7) = wired"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_inc_refunded_wired",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
-          "   AND"
-          "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    BOOL($6) = (order_serial IN"
-          "     (SELECT order_serial "
-          "      FROM merchant_refunds))"
-          "   AND"
-          "    BOOL($7) = wired"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2");
+           "lookup_orders_inc_refunded_wired",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
+           "   AND"
+           "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    BOOL($6) = (order_serial IN"
+           "     (SELECT order_serial "
+           "      FROM merchant_refunds))"
+           "   AND"
+           "    BOOL($7) = wired"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_inc_paid_refunded_wired",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
-          "   AND"
-          "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
-          "   AND"
-          "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial > $3"
-          "   AND"
-          "    creation_time > $4"
-          "   AND"
-          "    BOOL($5) = paid"
-          "   AND"
-          "    BOOL($6) = (order_serial IN"
-          "     (SELECT order_serial "
-          "      FROM merchant_refunds))"
-          "   AND"
-          "    BOOL($7) = wired"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2)"
-          " ORDER BY order_serial ASC"
-          " LIMIT $2");
+           "lookup_orders_inc_paid_refunded_wired",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
+           "   AND"
+           "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
+           "   AND"
+           "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial > $3"
+           "   AND"
+           "    creation_time > $4"
+           "   AND"
+           "    BOOL($5) = paid"
+           "   AND"
+           "    BOOL($6) = (order_serial IN"
+           "     (SELECT order_serial "
+           "      FROM merchant_refunds))"
+           "   AND"
+           "    BOOL($7) = wired"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2)"
+           " ORDER BY order_serial ASC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_dec",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2");
+           "lookup_orders_dec",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_dec_paid",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    BOOL($5) = paid"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2");
+           "lookup_orders_dec_paid",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    BOOL($5) = paid"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_dec_refunded",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    BOOL($6) = (order_serial IN"
-          "     (SELECT order_serial "
-          "      FROM merchant_refunds))"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2");
+           "lookup_orders_dec_refunded",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    BOOL($6) = (order_serial IN"
+           "     (SELECT order_serial "
+           "      FROM merchant_refunds))"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_dec_wired",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    BOOL($7) = wired"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2");
+           "lookup_orders_dec_wired",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    BOOL($7) = wired"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_dec_paid_refunded",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
-          "   AND"
-          "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    BOOL($5) = paid"
-          "   AND"
-          "    BOOL($6) = (order_serial IN"
-          "     (SELECT order_serial "
-          "      FROM merchant_refunds))"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2");
+           "lookup_orders_dec_paid_refunded",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
+           "   AND"
+           "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($7 as BOOL)" /* otherwise $7 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    BOOL($5) = paid"
+           "   AND"
+           "    BOOL($6) = (order_serial IN"
+           "     (SELECT order_serial "
+           "      FROM merchant_refunds))"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_dec_paid_wired",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
-          "   AND"
-          "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    BOOL($5) = paid"
-          "   AND"
-          "    BOOL($7) = wired"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2");
+           "lookup_orders_dec_paid_wired",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
+           "   AND"
+           "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($6 as BOOL)" /* otherwise $6 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    BOOL($5) = paid"
+           "   AND"
+           "    BOOL($7) = wired"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_dec_refunded_wired",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
-          "   AND"
-          "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy */
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    BOOL($6) = (order_serial IN"
-          "     (SELECT order_serial "
-          "      FROM merchant_refunds))"
-          "   AND"
-          "    BOOL($7) = wired"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2");
+           "lookup_orders_dec_refunded_wired",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
+           "   AND"
+           "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           ",CAST($5 as BOOL)" /* otherwise $5 is unused and Postgres unhappy 
*/
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    BOOL($6) = (order_serial IN"
+           "     (SELECT order_serial "
+           "      FROM merchant_refunds))"
+           "   AND"
+           "    BOOL($7) = wired"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2");
   PREPARE (pg,
-          "lookup_orders_dec_paid_refunded_wired",
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          " FROM merchant_orders"
-          " WHERE merchant_orders.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
-          "   AND"
-          "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
-          "   AND"
-          "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
-          "   AND"
-          "    order_serial NOT IN"
-          "     (SELECT order_serial"
-          "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          "UNION " /* union ensures elements are distinct! */
-          "(SELECT"
-          " order_id"
-          ",order_serial"
-          ",creation_time"
-          " FROM merchant_contract_terms"
-          " WHERE merchant_contract_terms.merchant_serial="
-          "     (SELECT merchant_serial "
-          "        FROM merchant_instances"
-          "        WHERE merchant_id=$1)"
-          "   AND"
-          "    order_serial < $3"
-          "   AND"
-          "    creation_time < $4"
-          "   AND"
-          "    BOOL($5) = paid"
-          "   AND"
-          "    BOOL($6) = (order_serial IN"
-          "     (SELECT order_serial "
+           "lookup_orders_dec_paid_refunded_wired",
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           " FROM merchant_orders"
+           " WHERE merchant_orders.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    NOT CAST($5 as BOOL)" /* unclaimed orders are never paid */
+           "   AND"
+           "    NOT CAST($6 as BOOL)"/* unclaimed orders are never refunded */
+           "   AND"
+           "    NOT CAST($7 as BOOL)" /* unclaimed orders are never wired */
+           "   AND"
+           "    order_serial NOT IN"
+           "     (SELECT order_serial"
+           "      FROM merchant_contract_terms)" /* only select unclaimed 
orders */
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           "UNION " /* union ensures elements are distinct! */
+           "(SELECT"
+           " order_id"
+           ",order_serial"
+           ",creation_time"
+           " FROM merchant_contract_terms"
+           " WHERE merchant_contract_terms.merchant_serial="
+           "     (SELECT merchant_serial "
+           "        FROM merchant_instances"
+           "        WHERE merchant_id=$1)"
+           "   AND"
+           "    order_serial < $3"
+           "   AND"
+           "    creation_time < $4"
+           "   AND"
+           "    BOOL($5) = paid"
+           "   AND"
+           "    BOOL($6) = (order_serial IN"
+           "     (SELECT order_serial "
 
-          "      FROM merchant_refunds))"
-          "   AND"
-          "    BOOL($7) = wired"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2)"
-          " ORDER BY order_serial DESC"
-          " LIMIT $2");
+           "      FROM merchant_refunds))"
+           "   AND"
+           "    BOOL($7) = wired"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2)"
+           " ORDER BY order_serial DESC"
+           " LIMIT $2");
   qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn,
                                              stmt,
                                              params,
diff --git a/src/backenddb/pg_lookup_products.c 
b/src/backenddb/pg_lookup_products.c
index 942d54f1..d16aeb8d 100644
--- a/src/backenddb/pg_lookup_products.c
+++ b/src/backenddb/pg_lookup_products.c
@@ -86,6 +86,7 @@ lookup_products_cb (void *cls,
   }
 }
 
+
 enum GNUNET_DB_QueryStatus
 TMH_PG_lookup_products (void *cls,
                         const char *instance_id,
diff --git a/src/backenddb/pg_lookup_refunds.h 
b/src/backenddb/pg_lookup_refunds.h
index dcd0d203..2b047019 100644
--- a/src/backenddb/pg_lookup_refunds.h
+++ b/src/backenddb/pg_lookup_refunds.h
@@ -38,7 +38,8 @@
 enum GNUNET_DB_QueryStatus
 TMH_PG_lookup_refunds (void *cls,
                        const char *instance_id,
-                       const struct TALER_PrivateContractHashP 
*h_contract_terms,
+                       const struct
+                       TALER_PrivateContractHashP *h_contract_terms,
                        TALER_MERCHANTDB_RefundCallback rc,
                        void *rc_cls);
 
diff --git a/src/backenddb/pg_mark_contract_paid.h 
b/src/backenddb/pg_mark_contract_paid.h
index 20c87bd2..591e440e 100644
--- a/src/backenddb/pg_mark_contract_paid.h
+++ b/src/backenddb/pg_mark_contract_paid.h
@@ -39,7 +39,8 @@
 enum GNUNET_DB_QueryStatus
 TMH_PG_mark_contract_paid (void *cls,
                            const char *instance_id,
-                           const struct TALER_PrivateContractHashP 
*h_contract_terms,
+                           const struct
+                           TALER_PrivateContractHashP *h_contract_terms,
                            const char *session_id);
 
 #endif
diff --git a/src/backenddb/pg_set_transfer_status_to_confirmed.c 
b/src/backenddb/pg_set_transfer_status_to_confirmed.c
index 767cd0d6..9b53e987 100644
--- a/src/backenddb/pg_set_transfer_status_to_confirmed.c
+++ b/src/backenddb/pg_set_transfer_status_to_confirmed.c
@@ -39,8 +39,8 @@ TMH_PG_set_transfer_status_to_confirmed (
     GNUNET_PQ_query_param_string (instance_id),
     GNUNET_PQ_query_param_auto_from_type (wtid),
     GNUNET_PQ_query_param_string (exchange_url),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       amount),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 amount),
     GNUNET_PQ_query_param_end
   };
 
diff --git a/src/backenddb/pg_store_wire_fee_by_exchange.c 
b/src/backenddb/pg_store_wire_fee_by_exchange.c
index f552b1fe..ce5b48ca 100644
--- a/src/backenddb/pg_store_wire_fee_by_exchange.c
+++ b/src/backenddb/pg_store_wire_fee_by_exchange.c
@@ -40,10 +40,10 @@ TMH_PG_store_wire_fee_by_exchange (
   struct GNUNET_PQ_QueryParam params[] = {
     GNUNET_PQ_query_param_auto_from_type (master_pub),
     GNUNET_PQ_query_param_auto_from_type (h_wire_method),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &fees->wire),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &fees->closing),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &fees->wire),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &fees->closing),
     GNUNET_PQ_query_param_timestamp (&start_date),
     GNUNET_PQ_query_param_timestamp (&end_date),
     GNUNET_PQ_query_param_auto_from_type (master_sig),
diff --git a/src/backenddb/pg_update_instance.c 
b/src/backenddb/pg_update_instance.c
index b94fda08..e1f98d73 100644
--- a/src/backenddb/pg_update_instance.c
+++ b/src/backenddb/pg_update_instance.c
@@ -37,10 +37,10 @@ TMH_PG_update_instance (void *cls,
     GNUNET_PQ_query_param_string (is->name),
     TALER_PQ_query_param_json (is->address),
     TALER_PQ_query_param_json (is->jurisdiction),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &is->default_max_deposit_fee),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &is->default_max_wire_fee),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &is->default_max_deposit_fee),
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &is->default_max_wire_fee),
     GNUNET_PQ_query_param_uint32 (&is->default_wire_fee_amortization),
     GNUNET_PQ_query_param_relative_time (
       &is->default_wire_transfer_delay),
diff --git a/src/backenddb/pg_update_instance_auth.h 
b/src/backenddb/pg_update_instance_auth.h
index cf0bc963..9b637b7c 100644
--- a/src/backenddb/pg_update_instance_auth.h
+++ b/src/backenddb/pg_update_instance_auth.h
@@ -37,6 +37,7 @@
 enum GNUNET_DB_QueryStatus
 TMH_PG_update_instance_auth (void *cls,
                              const char *merchant_id,
-                             const struct 
TALER_MERCHANTDB_InstanceAuthSettings *is);
+                             const struct
+                             TALER_MERCHANTDB_InstanceAuthSettings *is);
 
 #endif
diff --git a/src/backenddb/pg_update_product.c 
b/src/backenddb/pg_update_product.c
index ea845781..d721c1fe 100644
--- a/src/backenddb/pg_update_product.c
+++ b/src/backenddb/pg_update_product.c
@@ -41,8 +41,8 @@ TMH_PG_update_product (void *cls,
     GNUNET_PQ_query_param_string (pd->unit),
     GNUNET_PQ_query_param_string (pd->image), /* $6 */
     TALER_PQ_query_param_json (pd->taxes),
-    TALER_PQ_query_param_amount_tuple (pg->conn,
-                                       &pd->price), /* $8 */
+    TALER_PQ_query_param_amount (pg->conn,
+                                 &pd->price),       /* $8 */
     GNUNET_PQ_query_param_uint64 (&pd->total_stock),  /* $9 */
     GNUNET_PQ_query_param_uint64 (&pd->total_lost),
     TALER_PQ_query_param_json (pd->address),
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index 1ff6a7cf..b471f805 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -4571,8 +4571,9 @@ lookup_reserve_cb (void *cls,
   {
     for (unsigned int j = 0; rewards_length > j; ++j)
     {
-      if ((GNUNET_OK == TALER_amount_cmp_currency 
(&cmp->rewards[i].total_amount,
-                                                   &rewards[j].total_amount)) 
&&
+      if ((GNUNET_OK == TALER_amount_cmp_currency (
+             &cmp->rewards[i].total_amount,
+             &rewards[j].total_amount)) &&
           (0 == TALER_amount_cmp (&cmp->rewards[i].total_amount,
                                   &rewards[j].total_amount)) &&
           (0 == strcmp (cmp->rewards[i].reason,
@@ -4893,18 +4894,18 @@ make_reward (struct RewardData *reward)
  */
 static int
 test_authorize_reward (const struct InstanceData *instance,
-                    const struct ReserveData *reserve,
-                    struct RewardData *reward)
+                       const struct ReserveData *reserve,
+                       struct RewardData *reward)
 {
   TEST_COND_RET_ON_FAIL (TALER_EC_NONE ==
                          plugin->authorize_reward (plugin->cls,
-                                                instance->instance.id,
-                                                &reserve->reserve_pub,
-                                                &reward->details.total_amount,
-                                                reward->details.reason,
-                                                reward->next_url,
-                                                &reward->details.reward_id,
-                                                &reward->expiration),
+                                                   instance->instance.id,
+                                                   &reserve->reserve_pub,
+                                                   
&reward->details.total_amount,
+                                                   reward->details.reason,
+                                                   reward->next_url,
+                                                   &reward->details.reward_id,
+                                                   &reward->expiration),
                          "Authorize reward failed\n");
   return 0;
 }
@@ -4922,9 +4923,9 @@ test_authorize_reward (const struct InstanceData 
*instance,
  */
 static int
 test_lookup_reward (const struct InstanceData *instance,
-                 const struct ReserveData *reserve,
-                 const struct RewardData *reward,
-                 const struct TALER_Amount *expected_total_picked_up)
+                    const struct ReserveData *reserve,
+                    const struct RewardData *reward,
+                    const struct TALER_Amount *expected_total_picked_up)
 {
   struct TALER_Amount total_authorized;
   struct TALER_Amount total_picked_up;
@@ -4934,14 +4935,14 @@ test_lookup_reward (const struct InstanceData *instance,
   struct TALER_ReservePrivateKeyP reserve_priv;
 
   if (1 != plugin->lookup_reward (plugin->cls,
-                               instance->instance.id,
-                               &reward->details.reward_id,
-                               &total_authorized,
-                               &total_picked_up,
-                               &expiration,
-                               &exchange_url,
-                               &next_url,
-                               &reserve_priv))
+                                  instance->instance.id,
+                                  &reward->details.reward_id,
+                                  &total_authorized,
+                                  &total_picked_up,
+                                  &expiration,
+                                  &exchange_url,
+                                  &next_url,
+                                  &reserve_priv))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Lookup reward failed\n");
@@ -5011,16 +5012,16 @@ test_lookup_reward_details (
 
   if (0 >
       plugin->lookup_reward_details (plugin->cls,
-                                  instance->instance.id,
-                                  &reward->details.reward_id,
-                                  true,
-                                  &total_authorized,
-                                  &total_picked_up,
-                                  &justification,
-                                  &expiration,
-                                  &reserve_pub,
-                                  &pickups_length,
-                                  &pickups))
+                                     instance->instance.id,
+                                     &reward->details.reward_id,
+                                     true,
+                                     &total_authorized,
+                                     &total_picked_up,
+                                     &justification,
+                                     &expiration,
+                                     &reserve_pub,
+                                     &pickups_length,
+                                     &pickups))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Lookup reward details failed\n");
@@ -5230,9 +5231,9 @@ struct TestLookupRewards_Closure
  */
 static void
 lookup_rewards_cb (void *cls,
-                uint64_t row_id,
-                struct TALER_RewardIdentifierP reward_id,
-                struct TALER_Amount amount)
+                   uint64_t row_id,
+                   struct TALER_RewardIdentifierP reward_id,
+                   struct TALER_Amount amount)
 {
   struct TestLookupRewards_Closure *cmp = cls;
   if (NULL == cmp)
@@ -5267,11 +5268,11 @@ lookup_rewards_cb (void *cls,
  */
 static int
 test_lookup_rewards (const struct InstanceData *instance,
-                  enum TALER_EXCHANGE_YesNoAll expired,
-                  int64_t limit,
-                  uint64_t offset,
-                  unsigned int rewards_length,
-                  const struct RewardData *rewards)
+                     enum TALER_EXCHANGE_YesNoAll expired,
+                     int64_t limit,
+                     uint64_t offset,
+                     unsigned int rewards_length,
+                     const struct RewardData *rewards)
 {
   bool results_match[rewards_length];
   struct TestLookupRewards_Closure cmp = {
@@ -5285,12 +5286,12 @@ test_lookup_rewards (const struct InstanceData 
*instance,
           0,
           sizeof (bool) * rewards_length);
   if (0 > plugin->lookup_rewards (plugin->cls,
-                               instance->instance.id,
-                               expired,
-                               limit,
-                               offset,
-                               &lookup_rewards_cb,
-                               &cmp))
+                                  instance->instance.id,
+                                  expired,
+                                  limit,
+                                  offset,
+                                  &lookup_rewards_cb,
+                                  &cmp))
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Lookup rewards failed\n");
@@ -5323,7 +5324,7 @@ test_lookup_rewards (const struct InstanceData *instance,
  */
 static void
 reverse_reward_data_array (unsigned int rewards_length,
-                        struct RewardData *rewards)
+                           struct RewardData *rewards)
 {
   struct RewardData tmp[rewards_length];
   for (unsigned int i = 0; i < rewards_length; ++i)
@@ -5503,28 +5504,30 @@ run_test_rewards (struct TestRewards_Closure *cls)
                                                   NULL));
   /* Test inserting a reward */
   TEST_RET_ON_FAIL (test_authorize_reward (&cls->instance,
-                                        &cls->reserve,
-                                        &cls->reward));
+                                           &cls->reserve,
+                                           &cls->reward));
   /* Test lookup reward */
   TEST_RET_ON_FAIL (test_lookup_reward (&cls->instance,
-                                     &cls->reserve,
-                                     &cls->reward,
-                                     &zero));
+                                        &cls->reserve,
+                                        &cls->reward,
+                                        &zero));
   /* Test lookup reward details */
   TEST_RET_ON_FAIL (test_lookup_reward_details (&cls->instance,
-                                             &cls->reserve,
-                                             &cls->reward,
-                                             &zero,
-                                             0,
-                                             NULL));
+                                                &cls->reserve,
+                                                &cls->reward,
+                                                &zero,
+                                                0,
+                                                NULL));
   /* Test insert pickup */
   TEST_COND_RET_ON_FAIL (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT ==
                          plugin->insert_pickup (plugin->cls,
                                                 cls->instance.instance.id,
                                                 &cls->reward.details.reward_id,
-                                                
&cls->reward.details.total_amount,
+                                                &cls->reward.details.
+                                                total_amount,
                                                 &cls->pickup_id,
-                                                
&cls->reward.details.total_amount),
+                                                &cls->reward.details.
+                                                total_amount),
                          "Insert pickup failed\n");
   /* Test lookup pickup */
   TEST_RET_ON_FAIL (test_lookup_pickup (&cls->instance,
@@ -5544,22 +5547,23 @@ run_test_rewards (struct TestRewards_Closure *cls)
   /* Test that overdrawing the reserve fails */
   TEST_COND_RET_ON_FAIL (TALER_EC_NONE !=
                          plugin->authorize_reward (plugin->cls,
-                                                cls->instance.instance.id,
-                                                &cls->reserve.reserve_pub,
-                                                &cls->bigreward.details.
-                                                total_amount,
-                                                cls->bigreward.details.reason,
-                                                cls->bigreward.next_url,
-                                                
&cls->bigreward.details.reward_id,
-                                                &cls->reserve.expiration),
+                                                   cls->instance.instance.id,
+                                                   &cls->reserve.reserve_pub,
+                                                   &cls->bigreward.details.
+                                                   total_amount,
+                                                   
cls->bigreward.details.reason,
+                                                   cls->bigreward.next_url,
+                                                   &cls->bigreward.details.
+                                                   reward_id,
+                                                   &cls->reserve.expiration),
                          "Authorize reward failed\n");
   /* Test lookup rewards */
   TEST_RET_ON_FAIL (test_lookup_rewards (&cls->instance,
-                                      TALER_EXCHANGE_YNA_ALL,
-                                      1,
-                                      0,
-                                      1,
-                                      &cls->reward));
+                                         TALER_EXCHANGE_YNA_ALL,
+                                         1,
+                                         0,
+                                         1,
+                                         &cls->reward));
   /* Test lookup reserves */
   TEST_RET_ON_FAIL (test_lookup_reserves (&cls->instance,
                                           1,
@@ -5584,14 +5588,14 @@ run_test_rewards (struct TestRewards_Closure *cls)
       if (i % 2 == 0)
       {
         TEST_RET_ON_FAIL (test_authorize_reward (&cls->instance,
-                                              &cls->expired_reserve,
-                                              &cls->rewards[i]));
+                                                 &cls->expired_reserve,
+                                                 &cls->rewards[i]));
       }
       else
       {
         TEST_RET_ON_FAIL (test_authorize_reward (&cls->instance,
-                                              &cls->reserve,
-                                              &cls->rewards[i]));
+                                                 &cls->reserve,
+                                                 &cls->rewards[i]));
       }
     }
     GNUNET_memcpy (&expected_rewards[1],
@@ -5599,58 +5603,58 @@ run_test_rewards (struct TestRewards_Closure *cls)
                    sizeof (struct RewardData) * 5);
     /* Test lookup rewards inc */
     TEST_RET_ON_FAIL (test_lookup_rewards (&cls->instance,
-                                        TALER_EXCHANGE_YNA_ALL,
-                                        6,
-                                        0,
-                                        6,
-                                        expected_rewards));
+                                           TALER_EXCHANGE_YNA_ALL,
+                                           6,
+                                           0,
+                                           6,
+                                           expected_rewards));
     reverse_reward_data_array (6,
-                            expected_rewards);
+                               expected_rewards);
     /* Test lookup rewards dec */
     TEST_RET_ON_FAIL (test_lookup_rewards (&cls->instance,
-                                        TALER_EXCHANGE_YNA_ALL,
-                                        -6,
-                                        10,
-                                        6,
-                                        expected_rewards));
+                                           TALER_EXCHANGE_YNA_ALL,
+                                           -6,
+                                           10,
+                                           6,
+                                           expected_rewards));
     /* Test lookup rewards expired inc */
     expected_rewards[0] = cls->rewards[0];
     expected_rewards[1] = cls->rewards[2];
     expected_rewards[2] = cls->rewards[4];
     TEST_RET_ON_FAIL (test_lookup_rewards (&cls->instance,
-                                        TALER_EXCHANGE_YNA_YES,
-                                        6,
-                                        0,
-                                        3,
-                                        expected_rewards));
+                                           TALER_EXCHANGE_YNA_YES,
+                                           6,
+                                           0,
+                                           3,
+                                           expected_rewards));
     /* Test lookup rewards expired dec */
     reverse_reward_data_array (3,
-                            expected_rewards);
+                               expected_rewards);
     TEST_RET_ON_FAIL (test_lookup_rewards (&cls->instance,
-                                        TALER_EXCHANGE_YNA_YES,
-                                        -6,
-                                        10,
-                                        3,
-                                        expected_rewards));
+                                           TALER_EXCHANGE_YNA_YES,
+                                           -6,
+                                           10,
+                                           3,
+                                           expected_rewards));
     /* Test lookup rewards unexpired inc */
     expected_rewards[0] = cls->reward;
     expected_rewards[1] = cls->rewards[1];
     expected_rewards[2] = cls->rewards[3];
     TEST_RET_ON_FAIL (test_lookup_rewards (&cls->instance,
-                                        TALER_EXCHANGE_YNA_NO,
-                                        6,
-                                        0,
-                                        3,
-                                        expected_rewards));
+                                           TALER_EXCHANGE_YNA_NO,
+                                           6,
+                                           0,
+                                           3,
+                                           expected_rewards));
     /* Test lookup rewards unexpired dec */
     reverse_reward_data_array (3,
-                            expected_rewards);
+                               expected_rewards);
     TEST_RET_ON_FAIL (test_lookup_rewards (&cls->instance,
-                                        TALER_EXCHANGE_YNA_NO,
-                                        -6,
-                                        10,
-                                        3,
-                                        expected_rewards));
+                                           TALER_EXCHANGE_YNA_NO,
+                                           -6,
+                                           10,
+                                           3,
+                                           expected_rewards));
   }
   /* Test delete reserve private key */
   TEST_COND_RET_ON_FAIL (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT ==
diff --git a/src/include/taler_merchant_testing_lib.h 
b/src/include/taler_merchant_testing_lib.h
index abea85d4..752342ab 100644
--- a/src/include/taler_merchant_testing_lib.h
+++ b/src/include/taler_merchant_testing_lib.h
@@ -1166,10 +1166,11 @@ TALER_TESTING_cmd_merchant_get_reserve (const char 
*label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_merchant_get_reserve_with_rewards (const char *label,
-                                                  const char *merchant_url,
-                                                  unsigned int http_status,
-                                                  const char 
*reserve_reference,
-                                                  ...);
+                                                     const char *merchant_url,
+                                                     unsigned int http_status,
+                                                     const char *
+                                                     reserve_reference,
+                                                     ...);
 
 
 /**
@@ -1237,9 +1238,9 @@ TALER_TESTING_cmd_merchant_purge_reserve (const char 
*label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_get_rewards (const char *label,
-                            const char *merchant_url,
-                            unsigned int http_status,
-                            ...);
+                               const char *merchant_url,
+                               unsigned int http_status,
+                               ...);
 
 
 /**
@@ -1258,11 +1259,11 @@ TALER_TESTING_cmd_get_rewards (const char *label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_get_rewards2 (const char *label,
-                             const char *merchant_url,
-                             uint64_t offset,
-                             int64_t limit,
-                             unsigned int http_status,
-                             ...);
+                                const char *merchant_url,
+                                uint64_t offset,
+                                int64_t limit,
+                                unsigned int http_status,
+                                ...);
 
 
 /**
@@ -1276,9 +1277,9 @@ TALER_TESTING_cmd_get_rewards2 (const char *label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_merchant_get_reward (const char *label,
-                                    const char *merchant_url,
-                                    const char *reward_reference,
-                                    unsigned int http_status);
+                                       const char *merchant_url,
+                                       const char *reward_reference,
+                                       unsigned int http_status);
 
 
 /**
@@ -1295,10 +1296,10 @@ TALER_TESTING_cmd_merchant_get_reward (const char 
*label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_merchant_get_reward_with_pickups (const char *label,
-                                                 const char *merchant_url,
-                                                 const char *reward_reference,
-                                                 unsigned int http_status,
-                                                 ...);
+                                                    const char *merchant_url,
+                                                    const char 
*reward_reference,
+                                                    unsigned int http_status,
+                                                    ...);
 
 /**
  * Define a GET /rewards/$REWARD_ID CMD.
@@ -1311,9 +1312,9 @@ TALER_TESTING_cmd_merchant_get_reward_with_pickups (const 
char *label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_wallet_get_reward (const char *label,
-                                  const char *merchant_url,
-                                  const char *reward_reference,
-                                  unsigned int http_status);
+                                     const char *merchant_url,
+                                     const char *reward_reference,
+                                     unsigned int http_status);
 
 
 /**
@@ -1328,10 +1329,10 @@ TALER_TESTING_cmd_wallet_get_reward (const char *label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_wallet_get_reward2 (const char *label,
-                                   const char *merchant_url,
-                                   const char *reward_reference,
-                                   const char *amount_remaining,
-                                   unsigned int http_status);
+                                      const char *merchant_url,
+                                      const char *reward_reference,
+                                      const char *amount_remaining,
+                                      unsigned int http_status);
 
 
 /**
@@ -1350,11 +1351,11 @@ TALER_TESTING_cmd_wallet_get_reward2 (const char *label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_reward_authorize (const char *label,
-                                 const char *merchant_url,
-                                 const char *exchange_url,
-                                 unsigned int http_status,
-                                 const char *justification,
-                                 const char *amount);
+                                    const char *merchant_url,
+                                    const char *exchange_url,
+                                    unsigned int http_status,
+                                    const char *justification,
+                                    const char *amount);
 
 
 /**
@@ -1375,12 +1376,12 @@ TALER_TESTING_cmd_reward_authorize (const char *label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_reward_authorize_from_reserve (const char *label,
-                                              const char *merchant_url,
-                                              const char *exchange_url,
-                                              const char *reserve_reference,
-                                              unsigned int http_status,
-                                              const char *justification,
-                                              const char *amount);
+                                                 const char *merchant_url,
+                                                 const char *exchange_url,
+                                                 const char *reserve_reference,
+                                                 unsigned int http_status,
+                                                 const char *justification,
+                                                 const char *amount);
 
 
 /**
@@ -1401,12 +1402,12 @@ TALER_TESTING_cmd_reward_authorize_from_reserve (const 
char *label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_reward_authorize_with_ec (const char *label,
-                                         const char *merchant_url,
-                                         const char *exchange_url,
-                                         unsigned int http_status,
-                                         const char *justification,
-                                         const char *amount,
-                                         enum TALER_ErrorCode ec);
+                                            const char *merchant_url,
+                                            const char *exchange_url,
+                                            unsigned int http_status,
+                                            const char *justification,
+                                            const char *amount,
+                                            enum TALER_ErrorCode ec);
 
 
 /**
@@ -1469,11 +1470,11 @@ TALER_TESTING_cmd_reward_authorize_fake (const char 
*label);
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_reward_pickup_with_ec (const char *label,
-                                      const char *merchant_url,
-                                      unsigned int http_status,
-                                      const char *authorize_reference,
-                                      const char **amounts,
-                                      enum TALER_ErrorCode ec);
+                                         const char *merchant_url,
+                                         unsigned int http_status,
+                                         const char *authorize_reference,
+                                         const char **amounts,
+                                         enum TALER_ErrorCode ec);
 
 /**
  * Define a /reward-pickup CMD.
@@ -1490,10 +1491,10 @@ TALER_TESTING_cmd_reward_pickup_with_ec (const char 
*label,
  */
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_reward_pickup (const char *label,
-                              const char *merchant_url,
-                              unsigned int http_status,
-                              const char *authorize_reference,
-                              const char **amounts);
+                                 const char *merchant_url,
+                                 unsigned int http_status,
+                                 const char *authorize_reference,
+                                 const char **amounts);
 
 
 /**
diff --git a/src/lib/merchant_api_delete_account.c 
b/src/lib/merchant_api_delete_account.c
index e47833b7..42d8bc5d 100644
--- a/src/lib/merchant_api_delete_account.c
+++ b/src/lib/merchant_api_delete_account.c
@@ -74,8 +74,8 @@ struct TALER_MERCHANT_AccountDeleteHandle
  */
 static void
 handle_delete_account_finished (void *cls,
-                                 long response_code,
-                                 const void *response)
+                                long response_code,
+                                const void *response)
 {
   struct TALER_MERCHANT_AccountDeleteHandle *adh = cls;
   const json_t *json = response;
diff --git a/src/lib/merchant_api_delete_template.c 
b/src/lib/merchant_api_delete_template.c
index 0a5924aa..b2083cc9 100644
--- a/src/lib/merchant_api_delete_template.c
+++ b/src/lib/merchant_api_delete_template.c
@@ -74,8 +74,8 @@ struct TALER_MERCHANT_TemplateDeleteHandle
  */
 static void
 handle_delete_template_finished (void *cls,
-                                long response_code,
-                                const void *response)
+                                 long response_code,
+                                 const void *response)
 {
   struct TALER_MERCHANT_TemplateDeleteHandle *tdh = cls;
   const json_t *json = response;
diff --git a/src/lib/merchant_api_get_rewards.c 
b/src/lib/merchant_api_get_rewards.c
index 96ec4d34..eebc53d8 100644
--- a/src/lib/merchant_api_get_rewards.c
+++ b/src/lib/merchant_api_get_rewards.c
@@ -74,8 +74,8 @@ struct TALER_MERCHANT_RewardsGetHandle
  */
 static enum GNUNET_GenericReturnValue
 parse_rewards (const json_t *ia,
-            struct TALER_MERCHANT_RewardsGetResponse *tgr,
-            struct TALER_MERCHANT_RewardsGetHandle *tgh)
+               struct TALER_MERCHANT_RewardsGetResponse *tgr,
+               struct TALER_MERCHANT_RewardsGetHandle *tgh)
 {
   unsigned int tes_len = json_array_size (ia);
   struct TALER_MERCHANT_RewardEntry tes[GNUNET_NZL (tes_len)];
@@ -122,8 +122,8 @@ parse_rewards (const json_t *ia,
  */
 static void
 handle_get_rewards_finished (void *cls,
-                          long response_code,
-                          const void *response)
+                             long response_code,
+                             const void *response)
 {
   struct TALER_MERCHANT_RewardsGetHandle *tgh = cls;
   const json_t *json = response;
@@ -158,8 +158,8 @@ handle_get_rewards_finished (void *cls,
       }
       if (GNUNET_OK ==
           parse_rewards (rewards,
-                      &tgr,
-                      tgh))
+                         &tgr,
+                         tgh))
       {
         TALER_MERCHANT_rewards_get_cancel (tgh);
         return;
@@ -197,23 +197,23 @@ TALER_MERCHANT_rewards_get (
   void *cb_cls)
 {
   return TALER_MERCHANT_rewards_get2 (ctx,
-                                   backend_url,
-                                   TALER_EXCHANGE_YNA_NO,
-                                   -20,
-                                   UINT64_MAX,
-                                   cb,
-                                   cb_cls);
+                                      backend_url,
+                                      TALER_EXCHANGE_YNA_NO,
+                                      -20,
+                                      UINT64_MAX,
+                                      cb,
+                                      cb_cls);
 }
 
 
 struct TALER_MERCHANT_RewardsGetHandle *
 TALER_MERCHANT_rewards_get2 (struct GNUNET_CURL_Context *ctx,
-                          const char *backend_url,
-                          enum TALER_EXCHANGE_YesNoAll expired,
-                          int64_t limit,
-                          uint64_t offset,
-                          TALER_MERCHANT_RewardsGetCallback cb,
-                          void *cb_cls)
+                             const char *backend_url,
+                             enum TALER_EXCHANGE_YesNoAll expired,
+                             int64_t limit,
+                             uint64_t offset,
+                             TALER_MERCHANT_RewardsGetCallback cb,
+                             void *cb_cls)
 {
   struct TALER_MERCHANT_RewardsGetHandle *tgh;
   CURL *eh;
diff --git a/src/lib/merchant_api_merchant_get_reward.c 
b/src/lib/merchant_api_merchant_get_reward.c
index ba7306c0..a26c4243 100644
--- a/src/lib/merchant_api_merchant_get_reward.c
+++ b/src/lib/merchant_api_merchant_get_reward.c
@@ -112,8 +112,8 @@ parse_pickups (const json_t *pa,
  */
 static void
 handle_merchant_reward_get_finished (void *cls,
-                                  long response_code,
-                                  const void *response)
+                                     long response_code,
+                                     const void *response)
 {
   struct TALER_MERCHANT_RewardMerchantGetHandle *tgh = cls;
   const json_t *json = response;
@@ -214,13 +214,14 @@ handle_merchant_reward_get_finished (void *cls,
 
 struct TALER_MERCHANT_RewardMerchantGetHandle *
 TALER_MERCHANT_merchant_reward_get (struct GNUNET_CURL_Context *ctx,
-                                 const char *backend_url,
-                                 const struct TALER_RewardIdentifierP 
*reward_id,
-                                 const struct TALER_Amount *min_pick_up,
-                                 struct GNUNET_TIME_Relative lp_timeout,
-                                 bool pickups,
-                                 TALER_MERCHANT_RewardMerchantGetCallback cb,
-                                 void *cb_cls)
+                                    const char *backend_url,
+                                    const struct
+                                    TALER_RewardIdentifierP *reward_id,
+                                    const struct TALER_Amount *min_pick_up,
+                                    struct GNUNET_TIME_Relative lp_timeout,
+                                    bool pickups,
+                                    TALER_MERCHANT_RewardMerchantGetCallback 
cb,
+                                    void *cb_cls)
 {
   struct TALER_MERCHANT_RewardMerchantGetHandle *tgh;
   CURL *eh;
diff --git a/src/lib/merchant_api_post_account.c 
b/src/lib/merchant_api_post_account.c
index 68be6afd..5ed3f3b3 100644
--- a/src/lib/merchant_api_post_account.c
+++ b/src/lib/merchant_api_post_account.c
@@ -83,8 +83,8 @@ struct TALER_MERCHANT_AccountPostHandle
  */
 static void
 handle_post_account_finished (void *cls,
-                               long response_code,
-                               const void *response)
+                              long response_code,
+                              const void *response)
 {
   struct TALER_MERCHANT_AccountPostHandle *aph = cls;
   const json_t *json = response;
@@ -163,17 +163,17 @@ TALER_MERCHANT_account_post (
   json_t *req_obj;
 
   req_obj = GNUNET_JSON_PACK (
-        GNUNET_JSON_pack_string (
-          "payto_uri",
-          account->payto_uri),
-        GNUNET_JSON_pack_allow_null (
-          GNUNET_JSON_pack_string (
-            "credit_facade_url",
-            account->credit_facade_url)),
-        GNUNET_JSON_pack_allow_null (
-          GNUNET_JSON_pack_object_incref (
-            "credit_facade_credentials",
-            account->credit_facade_credentials))
+    GNUNET_JSON_pack_string (
+      "payto_uri",
+      account->payto_uri),
+    GNUNET_JSON_pack_allow_null (
+      GNUNET_JSON_pack_string (
+        "credit_facade_url",
+        account->credit_facade_url)),
+    GNUNET_JSON_pack_allow_null (
+      GNUNET_JSON_pack_object_incref (
+        "credit_facade_credentials",
+        account->credit_facade_credentials))
     );
   aph = GNUNET_new (struct TALER_MERCHANT_AccountPostHandle);
   aph->ctx = ctx;
diff --git a/src/lib/merchant_api_post_using_templates.c 
b/src/lib/merchant_api_post_using_templates.c
index d72768f3..f09c34cb 100644
--- a/src/lib/merchant_api_post_using_templates.c
+++ b/src/lib/merchant_api_post_using_templates.c
@@ -89,9 +89,9 @@ handle_post_using_templates_finished (void *cls,
 
   utph->job = NULL;
   TALER_MERCHANT_handle_order_creation_response_ (utph->cb,
-                                                            utph->cb_cls,
-                                                            response_code,
-                                                            json);
+                                                  utph->cb_cls,
+                                                  response_code,
+                                                  json);
   TALER_MERCHANT_using_templates_post_cancel (utph);
 }
 
diff --git a/src/lib/merchant_api_reward_authorize.c 
b/src/lib/merchant_api_reward_authorize.c
index b250031b..a695e378 100644
--- a/src/lib/merchant_api_reward_authorize.c
+++ b/src/lib/merchant_api_reward_authorize.c
@@ -136,8 +136,8 @@ check_ok (struct TALER_MERCHANT_RewardAuthorizeHandle *tao,
  */
 static void
 handle_reward_authorize_finished (void *cls,
-                               long response_code,
-                               const void *response)
+                                  long response_code,
+                                  const void *response)
 {
   struct TALER_MERCHANT_RewardAuthorizeHandle *tao = cls;
   const json_t *json = response;
@@ -294,12 +294,13 @@ TALER_MERCHANT_reward_authorize2 (
 
 struct TALER_MERCHANT_RewardAuthorizeHandle *
 TALER_MERCHANT_reward_authorize (struct GNUNET_CURL_Context *ctx,
-                              const char *backend_url,
-                              const char *next_url,
-                              const struct TALER_Amount *amount,
-                              const char *justification,
-                              TALER_MERCHANT_RewardAuthorizeCallback 
authorize_cb,
-                              void *authorize_cb_cls)
+                                 const char *backend_url,
+                                 const char *next_url,
+                                 const struct TALER_Amount *amount,
+                                 const char *justification,
+                                 TALER_MERCHANT_RewardAuthorizeCallback
+                                 authorize_cb,
+                                 void *authorize_cb_cls)
 {
   struct TALER_MERCHANT_RewardAuthorizeHandle *tao;
   CURL *eh;
diff --git a/src/lib/merchant_api_reward_pickup.c 
b/src/lib/merchant_api_reward_pickup.c
index 1d884d48..fd5cf9cc 100644
--- a/src/lib/merchant_api_reward_pickup.c
+++ b/src/lib/merchant_api_reward_pickup.c
@@ -264,12 +264,12 @@ pickup_post_csr (struct TALER_MERCHANT_RewardPickupHandle 
*tp)
     }
   }
   tp->tpo2 = TALER_MERCHANT_reward_pickup2 (tp->ctx,
-                                         tp->backend_url,
-                                         &tp->reward_id,
-                                         tp->num_planchets,
-                                         details,
-                                         &pickup_done_cb,
-                                         tp);
+                                            tp->backend_url,
+                                            &tp->reward_id,
+                                            tp->num_planchets,
+                                            details,
+                                            &pickup_done_cb,
+                                            tp);
   for (unsigned int j = 0; j<tp->num_planchets; j++)
     TALER_planchet_detail_free (&details[j]);
   if (NULL == tp->tpo2)
@@ -408,7 +408,8 @@ TALER_MERCHANT_reward_pickup (
 
 
 void
-TALER_MERCHANT_reward_pickup_cancel (struct TALER_MERCHANT_RewardPickupHandle 
*tp)
+TALER_MERCHANT_reward_pickup_cancel (struct
+                                     TALER_MERCHANT_RewardPickupHandle *tp)
 {
   for (unsigned int i = 0; i<tp->num_planchets; i++)
   {
diff --git a/src/lib/merchant_api_reward_pickup2.c 
b/src/lib/merchant_api_reward_pickup2.c
index 397f1a2b..45ebf266 100644
--- a/src/lib/merchant_api_reward_pickup2.c
+++ b/src/lib/merchant_api_reward_pickup2.c
@@ -160,8 +160,8 @@ check_ok (struct TALER_MERCHANT_RewardPickup2Handle *tpo,
  */
 static void
 handle_reward_pickup_finished (void *cls,
-                            long response_code,
-                            const void *response)
+                               long response_code,
+                               const void *response)
 {
   struct TALER_MERCHANT_RewardPickup2Handle *tpo = cls;
   const json_t *json = response;
@@ -189,8 +189,9 @@ handle_reward_pickup_finished (void *cls,
     /* Can happen if we pickup an amount that exceeds the reward... */
     tpr.hr.ec = TALER_JSON_get_error_code (json);
     tpr.hr.hint = TALER_JSON_get_error_hint (json);
-    GNUNET_break 
(TALER_EC_MERCHANT_REWARD_PICKUP_AMOUNT_EXCEEDS_REWARD_REMAINING ==
-                  tpr.hr.ec);
+    GNUNET_break (
+      TALER_EC_MERCHANT_REWARD_PICKUP_AMOUNT_EXCEEDS_REWARD_REMAINING ==
+      tpr.hr.ec);
     break;
   case MHD_HTTP_CONFLICT:
     /* legal, can happen if we pickup a reward twice... */
diff --git a/src/lib/merchant_api_wallet_get_reward.c 
b/src/lib/merchant_api_wallet_get_reward.c
index f548d692..534eb7f4 100644
--- a/src/lib/merchant_api_wallet_get_reward.c
+++ b/src/lib/merchant_api_wallet_get_reward.c
@@ -75,8 +75,8 @@ struct TALER_MERCHANT_RewardWalletGetHandle
  */
 static void
 handle_wallet_reward_get_finished (void *cls,
-                                long response_code,
-                                const void *response)
+                                   long response_code,
+                                   const void *response)
 {
   struct TALER_MERCHANT_RewardWalletGetHandle *tgh = cls;
   const json_t *json = response;
@@ -152,10 +152,11 @@ handle_wallet_reward_get_finished (void *cls,
 
 struct TALER_MERCHANT_RewardWalletGetHandle *
 TALER_MERCHANT_wallet_reward_get (struct GNUNET_CURL_Context *ctx,
-                               const char *backend_url,
-                               const struct TALER_RewardIdentifierP *reward_id,
-                               TALER_MERCHANT_RewardWalletGetCallback cb,
-                               void *cb_cls)
+                                  const char *backend_url,
+                                  const struct
+                                  TALER_RewardIdentifierP *reward_id,
+                                  TALER_MERCHANT_RewardWalletGetCallback cb,
+                                  void *cb_cls)
 {
   struct TALER_MERCHANT_RewardWalletGetHandle *tgh;
   CURL *eh;
diff --git a/src/testing/testing_api_cmd_config.c 
b/src/testing/testing_api_cmd_config.c
index cd071164..adde106a 100644
--- a/src/testing/testing_api_cmd_config.c
+++ b/src/testing/testing_api_cmd_config.c
@@ -119,7 +119,8 @@ config_run (void *cls,
   struct ConfigState *cs = cls;
 
   cs->is = is;
-  cs->vgh = TALER_MERCHANT_config_get (TALER_TESTING_interpreter_get_context 
(is),
+  cs->vgh = TALER_MERCHANT_config_get (TALER_TESTING_interpreter_get_context (
+                                         is),
                                        cs->merchant_url,
                                        &config_cb,
                                        cs);
diff --git a/src/testing/testing_api_cmd_delete_instance.c 
b/src/testing/testing_api_cmd_delete_instance.c
index 80ec1b34..36cc2964 100644
--- a/src/testing/testing_api_cmd_delete_instance.c
+++ b/src/testing/testing_api_cmd_delete_instance.c
@@ -123,17 +123,19 @@ delete_instance_run (void *cls,
 
   dis->is = is;
   if (dis->purge)
-    dis->igh = TALER_MERCHANT_instance_purge 
(TALER_TESTING_interpreter_get_context (is),
-                                              dis->merchant_url,
-                                              dis->instance_id,
-                                              &delete_instance_cb,
-                                              dis);
+    dis->igh = TALER_MERCHANT_instance_purge (
+      TALER_TESTING_interpreter_get_context (is),
+      dis->merchant_url,
+      dis->instance_id,
+      &delete_instance_cb,
+      dis);
   else
-    dis->igh = TALER_MERCHANT_instance_delete 
(TALER_TESTING_interpreter_get_context (is),
-                                               dis->merchant_url,
-                                               dis->instance_id,
-                                               &delete_instance_cb,
-                                               dis);
+    dis->igh = TALER_MERCHANT_instance_delete (
+      TALER_TESTING_interpreter_get_context (is),
+      dis->merchant_url,
+      dis->instance_id,
+      &delete_instance_cb,
+      dis);
   GNUNET_assert (NULL != dis->igh);
 }
 
diff --git a/src/testing/testing_api_cmd_delete_order.c 
b/src/testing/testing_api_cmd_delete_order.c
index e7ec065d..163538ca 100644
--- a/src/testing/testing_api_cmd_delete_order.c
+++ b/src/testing/testing_api_cmd_delete_order.c
@@ -121,12 +121,13 @@ delete_order_run (void *cls,
   struct DeleteOrderState *dos = cls;
 
   dos->is = is;
-  dos->odh = TALER_MERCHANT_order_delete 
(TALER_TESTING_interpreter_get_context (is),
-                                          dos->merchant_url,
-                                          dos->order_id,
-                                          false, /* FIXME: support testing 
force... */
-                                          &delete_order_cb,
-                                          dos);
+  dos->odh = TALER_MERCHANT_order_delete (
+    TALER_TESTING_interpreter_get_context (is),
+    dos->merchant_url,
+    dos->order_id,
+    false,                                       /* FIXME: support testing 
force... */
+    &delete_order_cb,
+    dos);
   GNUNET_assert (NULL != dos->odh);
 }
 
diff --git a/src/testing/testing_api_cmd_delete_product.c 
b/src/testing/testing_api_cmd_delete_product.c
index 91bbc0fa..77de9261 100644
--- a/src/testing/testing_api_cmd_delete_product.c
+++ b/src/testing/testing_api_cmd_delete_product.c
@@ -120,11 +120,12 @@ delete_product_run (void *cls,
   struct DeleteProductState *dis = cls;
 
   dis->is = is;
-  dis->pdh = TALER_MERCHANT_product_delete 
(TALER_TESTING_interpreter_get_context (is),
-                                            dis->merchant_url,
-                                            dis->product_id,
-                                            &delete_product_cb,
-                                            dis);
+  dis->pdh = TALER_MERCHANT_product_delete (
+    TALER_TESTING_interpreter_get_context (is),
+    dis->merchant_url,
+    dis->product_id,
+    &delete_product_cb,
+    dis);
   GNUNET_assert (NULL != dis->pdh);
 }
 
diff --git a/src/testing/testing_api_cmd_delete_reserve.c 
b/src/testing/testing_api_cmd_delete_reserve.c
index 6e69042d..38742630 100644
--- a/src/testing/testing_api_cmd_delete_reserve.c
+++ b/src/testing/testing_api_cmd_delete_reserve.c
@@ -133,17 +133,19 @@ delete_reserve_run (void *cls,
 
   drs->is = is;
   if (drs->purge)
-    drs->rdh = TALER_MERCHANT_reserve_purge 
(TALER_TESTING_interpreter_get_context (is),
-                                             drs->merchant_url,
-                                             reserve_pub,
-                                             &delete_reserve_cb,
-                                             drs);
+    drs->rdh = TALER_MERCHANT_reserve_purge (
+      TALER_TESTING_interpreter_get_context (is),
+      drs->merchant_url,
+      reserve_pub,
+      &delete_reserve_cb,
+      drs);
   else
-    drs->rdh = TALER_MERCHANT_reserve_delete 
(TALER_TESTING_interpreter_get_context (is),
-                                              drs->merchant_url,
-                                              reserve_pub,
-                                              &delete_reserve_cb,
-                                              drs);
+    drs->rdh = TALER_MERCHANT_reserve_delete (
+      TALER_TESTING_interpreter_get_context (is),
+      drs->merchant_url,
+      reserve_pub,
+      &delete_reserve_cb,
+      drs);
 
   GNUNET_assert (NULL != drs->rdh);
 }
diff --git a/src/testing/testing_api_cmd_delete_template.c 
b/src/testing/testing_api_cmd_delete_template.c
index 149fefeb..95259640 100644
--- a/src/testing/testing_api_cmd_delete_template.c
+++ b/src/testing/testing_api_cmd_delete_template.c
@@ -70,7 +70,7 @@ struct DeleteTemplateState
  */
 static void
 delete_template_cb (void *cls,
-                   const struct TALER_MERCHANT_HttpResponse *hr)
+                    const struct TALER_MERCHANT_HttpResponse *hr)
 {
   struct DeleteTemplateState *dis = cls;
 
@@ -114,17 +114,18 @@ delete_template_cb (void *cls,
  */
 static void
 delete_template_run (void *cls,
-                    const struct TALER_TESTING_Command *cmd,
-                    struct TALER_TESTING_Interpreter *is)
+                     const struct TALER_TESTING_Command *cmd,
+                     struct TALER_TESTING_Interpreter *is)
 {
   struct DeleteTemplateState *dis = cls;
 
   dis->is = is;
-  dis->tdh = TALER_MERCHANT_template_delete 
(TALER_TESTING_interpreter_get_context (is),
-                                            dis->merchant_url,
-                                            dis->template_id,
-                                            &delete_template_cb,
-                                            dis);
+  dis->tdh = TALER_MERCHANT_template_delete (
+    TALER_TESTING_interpreter_get_context (is),
+    dis->merchant_url,
+    dis->template_id,
+    &delete_template_cb,
+    dis);
   GNUNET_assert (NULL != dis->tdh);
 }
 
@@ -138,7 +139,7 @@ delete_template_run (void *cls,
  */
 static void
 delete_template_cleanup (void *cls,
-                        const struct TALER_TESTING_Command *cmd)
+                         const struct TALER_TESTING_Command *cmd)
 {
   struct DeleteTemplateState *dis = cls;
 
@@ -154,9 +155,9 @@ delete_template_cleanup (void *cls,
 
 struct TALER_TESTING_Command
 TALER_TESTING_cmd_merchant_delete_template (const char *label,
-                                           const char *merchant_url,
-                                           const char *template_id,
-                                           unsigned int http_status)
+                                            const char *merchant_url,
+                                            const char *template_id,
+                                            unsigned int http_status)
 {
   struct DeleteTemplateState *dis;
 
diff --git a/src/testing/testing_api_cmd_delete_transfer.c 
b/src/testing/testing_api_cmd_delete_transfer.c
index 18cb90b5..ae872dee 100644
--- a/src/testing/testing_api_cmd_delete_transfer.c
+++ b/src/testing/testing_api_cmd_delete_transfer.c
@@ -145,11 +145,12 @@ delete_transfer_run (void *cls,
     TALER_TESTING_interpreter_fail (dts->is);
     return;
   }
-  dts->tdh = TALER_MERCHANT_transfer_delete 
(TALER_TESTING_interpreter_get_context (is),
-                                             dts->merchant_url,
-                                             *tid,
-                                             &delete_transfer_cb,
-                                             dts);
+  dts->tdh = TALER_MERCHANT_transfer_delete (
+    TALER_TESTING_interpreter_get_context (is),
+    dts->merchant_url,
+    *tid,
+    &delete_transfer_cb,
+    dts);
   GNUNET_assert (NULL != dts->tdh);
 }
 
diff --git a/src/testing/testing_api_cmd_delete_webhook.c 
b/src/testing/testing_api_cmd_delete_webhook.c
index 38cec155..12654fe6 100644
--- a/src/testing/testing_api_cmd_delete_webhook.c
+++ b/src/testing/testing_api_cmd_delete_webhook.c
@@ -120,11 +120,12 @@ delete_webhook_run (void *cls,
   struct DeleteWebhookState *dis = cls;
 
   dis->is = is;
-  dis->wdh = TALER_MERCHANT_webhook_delete 
(TALER_TESTING_interpreter_get_context (is),
-                                            dis->merchant_url,
-                                            dis->webhook_id,
-                                            &delete_webhook_cb,
-                                            dis);
+  dis->wdh = TALER_MERCHANT_webhook_delete (
+    TALER_TESTING_interpreter_get_context (is),
+    dis->merchant_url,
+    dis->webhook_id,
+    &delete_webhook_cb,
+    dis);
   GNUNET_assert (NULL != dis->wdh);
 }
 
diff --git a/src/testing/testing_api_cmd_get_reserves.c 
b/src/testing/testing_api_cmd_get_reserves.c
index ee0be9dd..d62a73e3 100644
--- a/src/testing/testing_api_cmd_get_reserves.c
+++ b/src/testing/testing_api_cmd_get_reserves.c
@@ -206,13 +206,14 @@ get_reserves_run (void *cls,
   struct GetReservesState *grs = cls;
 
   grs->is = is;
-  grs->rgh = TALER_MERCHANT_reserves_get 
(TALER_TESTING_interpreter_get_context (is),
-                                          grs->merchant_url,
-                                          GNUNET_TIME_UNIT_ZERO_TS,
-                                          TALER_EXCHANGE_YNA_ALL,
-                                          TALER_EXCHANGE_YNA_ALL,
-                                          &get_reserves_cb,
-                                          grs);
+  grs->rgh = TALER_MERCHANT_reserves_get (
+    TALER_TESTING_interpreter_get_context (is),
+    grs->merchant_url,
+    GNUNET_TIME_UNIT_ZERO_TS,
+    TALER_EXCHANGE_YNA_ALL,
+    TALER_EXCHANGE_YNA_ALL,
+    &get_reserves_cb,
+    grs);
 
   GNUNET_assert (NULL != grs->rgh);
 }
diff --git a/src/testing/testing_api_cmd_kyc_get.c 
b/src/testing/testing_api_cmd_kyc_get.c
index 4b4e76fd..8c1e8fb4 100644
--- a/src/testing/testing_api_cmd_kyc_get.c
+++ b/src/testing/testing_api_cmd_kyc_get.c
@@ -267,7 +267,8 @@ kyc_get_run (void *cls,
     }
   }
   if (NULL == cs->instance_id)
-    cs->kgh = TALER_MERCHANT_kyc_get (TALER_TESTING_interpreter_get_context 
(is),
+    cs->kgh = TALER_MERCHANT_kyc_get (TALER_TESTING_interpreter_get_context (
+                                        is),
                                       cs->merchant_url,
                                       h_wire,
                                       cs->exchange_url,
@@ -275,14 +276,15 @@ kyc_get_run (void *cls,
                                       &kyc_get_cb,
                                       cs);
   else
-    cs->kgh = TALER_MERCHANT_management_kyc_get 
(TALER_TESTING_interpreter_get_context (is),
-                                                 cs->merchant_url,
-                                                 cs->instance_id,
-                                                 h_wire,
-                                                 cs->exchange_url,
-                                                 GNUNET_TIME_UNIT_ZERO,
-                                                 &kyc_get_cb,
-                                                 cs);
+    cs->kgh = TALER_MERCHANT_management_kyc_get (
+      TALER_TESTING_interpreter_get_context (is),
+      cs->merchant_url,
+      cs->instance_id,
+      h_wire,
+      cs->exchange_url,
+      GNUNET_TIME_UNIT_ZERO,
+      &kyc_get_cb,
+      cs);
 
   GNUNET_assert (NULL != cs->kgh);
 }
diff --git a/src/testing/testing_api_cmd_post_account.c 
b/src/testing/testing_api_cmd_post_account.c
index 3529b961..345e869f 100644
--- a/src/testing/testing_api_cmd_post_account.c
+++ b/src/testing/testing_api_cmd_post_account.c
@@ -123,11 +123,12 @@ post_account_run (void *cls,
   struct PostAccountState *pas = cls;
 
   pas->is = is;
-  pas->aph = TALER_MERCHANT_account_post 
(TALER_TESTING_interpreter_get_context (is),
-                                          pas->merchant_url,
-                                          &pas->ac,
-                                          &post_account_cb,
-                                          pas);
+  pas->aph = TALER_MERCHANT_account_post (
+    TALER_TESTING_interpreter_get_context (is),
+    pas->merchant_url,
+    &pas->ac,
+    &post_account_cb,
+    pas);
   GNUNET_assert (NULL != pas->aph);
 }
 
diff --git a/src/testing/testing_api_cmd_post_reserves.c 
b/src/testing/testing_api_cmd_post_reserves.c
index eca2970f..c8fe914d 100644
--- a/src/testing/testing_api_cmd_post_reserves.c
+++ b/src/testing/testing_api_cmd_post_reserves.c
@@ -165,13 +165,14 @@ post_reserves_run (void *cls,
   struct PostReservesState *prs = cls;
 
   prs->is = is;
-  prs->prh = TALER_MERCHANT_reserves_post 
(TALER_TESTING_interpreter_get_context (is),
-                                           prs->merchant_url,
-                                           &prs->initial_balance,
-                                           prs->exchange_url,
-                                           prs->wire_method,
-                                           &post_reserves_cb,
-                                           prs);
+  prs->prh = TALER_MERCHANT_reserves_post (
+    TALER_TESTING_interpreter_get_context (is),
+    prs->merchant_url,
+    &prs->initial_balance,
+    prs->exchange_url,
+    prs->wire_method,
+    &post_reserves_cb,
+    prs);
   GNUNET_assert (NULL != prs->prh);
 }
 
diff --git a/src/testing/testing_api_cmd_tme.c 
b/src/testing/testing_api_cmd_tme.c
index 758083a5..b84e1df5 100644
--- a/src/testing/testing_api_cmd_tme.c
+++ b/src/testing/testing_api_cmd_tme.c
@@ -55,8 +55,8 @@ struct MerchantExchangeState
  */
 static void
 tme_run (void *cls,
-             const struct TALER_TESTING_Command *cmd,
-             struct TALER_TESTING_Interpreter *is)
+         const struct TALER_TESTING_Command *cmd,
+         struct TALER_TESTING_Interpreter *is)
 {
   struct MerchantExchangeState *ws = cls;
 
@@ -89,7 +89,7 @@ tme_run (void *cls,
  */
 static void
 tme_cleanup (void *cls,
-                 const struct TALER_TESTING_Command *cmd)
+             const struct TALER_TESTING_Command *cmd)
 {
   struct MerchantExchangeState *ws = cls;
 
@@ -118,9 +118,9 @@ tme_cleanup (void *cls,
  */
 static enum GNUNET_GenericReturnValue
 tme_traits (void *cls,
-                const void **ret,
-                const char *trait,
-                unsigned int index)
+            const void **ret,
+            const char *trait,
+            unsigned int index)
 {
   struct MerchantExchangeState *ws = cls;
   struct TALER_TESTING_Trait traits[] = {

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