diff options
-rw-r--r-- | src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 5 | ||||
-rw-r--r-- | src/backenddb/plugin_merchantdb_postgres.c | 5 | ||||
-rw-r--r-- | src/include/taler_merchantdb_plugin.h | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c index ca041863..64ba5e66 100644 --- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c +++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c @@ -1593,6 +1593,11 @@ parse_pay (struct MHD_Connection *connection, GNUNET_assert (NULL != session_id); pc->session_id = GNUNET_strdup (session_id); } + else + { + /* use empty string as default if client didn't specify it */ + pc->session_id = GNUNET_strdup (""); + } } /* copy order ID */ diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c index 6e7b9554..06c2a170 100644 --- a/src/backenddb/plugin_merchantdb_postgres.c +++ b/src/backenddb/plugin_merchantdb_postgres.c @@ -2028,7 +2028,7 @@ postgres_lookup_refunds (void *cls, * @param cls closure * @param instance_id instance to mark contract as paid for * @param h_contract_terms hash of the contract that is now paid - * @param session_id the session that paid the contract, can be NULL + * @param session_id the session that paid the contract * @return transaction status */ static enum GNUNET_DB_QueryStatus @@ -2051,6 +2051,9 @@ postgres_mark_contract_paid (void *cls, }; enum GNUNET_DB_QueryStatus qs; + /* Session ID must always be given by the caller. */ + GNUNET_assert (NULL != session_id); + /* no preflight check here, run in transaction by caller! */ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Marking h_contract_terms '%s' of %s as paid for session `%s'\n", diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h index 16152245..2532289f 100644 --- a/src/include/taler_merchantdb_plugin.h +++ b/src/include/taler_merchantdb_plugin.h @@ -1228,7 +1228,7 @@ struct TALER_MERCHANTDB_Plugin * @param cls closure * @param instance_id instance to mark contract as paid for * @param h_contract_terms hash of the contract that is now paid - * @param session_id the session that paid the contract, can be NULL + * @param session_id the session that paid the contract * @return transaction status */ enum GNUNET_DB_QueryStatus |