aboutsummaryrefslogtreecommitdiff
path: root/src/exchange/taler-exchange-httpd_deposit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange/taler-exchange-httpd_deposit.c')
-rw-r--r--src/exchange/taler-exchange-httpd_deposit.c50
1 files changed, 33 insertions, 17 deletions
diff --git a/src/exchange/taler-exchange-httpd_deposit.c b/src/exchange/taler-exchange-httpd_deposit.c
index 033245f5..7c5ab92d 100644
--- a/src/exchange/taler-exchange-httpd_deposit.c
+++ b/src/exchange/taler-exchange-httpd_deposit.c
@@ -170,23 +170,6 @@ deposit_transaction (void *cls,
if (qs < 0)
return qs;
- /* Check and apply policies, if applicable */
- if (NULL != dc->policy_extension)
- {
- const struct TALER_Extension *ext = dc->policy_extension;
- struct TALER_ExtensionsPolicySerialID serialID;
- struct GNUNET_TIME_Timestamp deadline;
- GNUNET_assert (ext->parse_policy_details);
-
- qs = ext->parse_policy_details (dc->deposit->policy_details,
- &serialID,
- &deadline);
-
- if (qs < 0)
- return qs;
-
- blocked_by_policy = true;
- }
qs = TEH_plugin->do_deposit (TEH_plugin->cls,
dc->deposit,
@@ -351,6 +334,39 @@ TEH_handler_deposit (struct MHD_Connection *connection,
&h_wire);
dc.deposit = &deposit;
+ /* TODO: extract policy information */
+#if 0
+ if (! deposit.no_policy_details)
+ {
+ const struct TALER_Extension *ext;
+ struct TALER_ExtensionsPolicySerialID serialID;
+ struct GNUNET_TIME_Timestamp deadline;
+ enum GNUNET_GenericReturnValue ret;
+ GNUNET_assert (ext->parse_policy_details);
+
+
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "DEBUG calling parse_policy_details on extension '%s' with details '%s'\n",
+ ext->name,
+ json_dumps (dc->deposit->policy_details, JSON_INDENT (2)));
+
+ ret = ext->parse_policy_details (dc->deposit->policy_details,
+ &serialID,
+ &deadline);
+
+ if (GNUNET_OK != ret)
+ {
+ TALER_LOG_WARNING ("Failed to parse policy details\n");
+ *mhd_ret = TALER_MHD_reply_with_error (connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_GENERIC_DB_STORE_FAILED,
+ "deposit");
+ return GNUNET_DB_STATUS_HARD_ERROR;
+ }
+ blocked_by_policy = true;
+ }
+#endif
+
/* new deposit */
dc.exchange_timestamp = GNUNET_TIME_timestamp_get ();
/* check denomination exists and is valid */