diff options
| author | Özgür Kesim <oec-taler@kesim.org> | 2022-10-07 09:59:39 +0200 |
|---|---|---|
| committer | Özgür Kesim <oec-taler@kesim.org> | 2022-10-07 09:59:39 +0200 |
| commit | d3c509fcd91e5b7e430eda767108d961db196522 (patch) | |
| tree | 1c647b3e9f5992415682e8c501006a4ecf55a514 /src/include | |
| parent | 52106eea42698164fef897f4b177f783275d5c75 (diff) | |
WIP: Added policy extension handling during deposit
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/taler_exchangedb_plugin.h | 15 | ||||
| -rw-r--r-- | src/include/taler_extensions.h | 19 |
2 files changed, 19 insertions, 15 deletions
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index b03c004f..0766c091 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -1445,6 +1445,19 @@ struct TALER_EXCHANGEDB_Deposit bool no_policy_details; /** + * If policy_details are present, the corresponding policy extension calculates + * a serial id under which the policy_details shall be stored in the policy_details table. + */ + struct GNUNET_HashCode policy_serial_id; + + /** + * If policy_details are present, the corresponding policy extension can + * set a deadline for this policy. Can be "forever". + */ + struct GNUNET_TIME_Timestamp policy_deadline; + + + /** * Hash over the @e policy_details. Only filled if no_policy_details is false. */ struct TALER_ExtensionPolicyHashP h_policy; @@ -3323,7 +3336,6 @@ struct TALER_EXCHANGEDB_Plugin * @param deposit deposit operation details * @param known_coin_id row of the coin in the known_coins table * @param h_payto hash of the merchant's payto URI - * @param policy_blocked true if an policy extension is blocking the wire transfer * @param[in,out] exchange_timestamp time to use for the deposit (possibly updated) * @param[out] balance_ok set to true if the balance was sufficient * @param[out] in_conflict set to true if the deposit conflicted @@ -3335,7 +3347,6 @@ struct TALER_EXCHANGEDB_Plugin const struct TALER_EXCHANGEDB_Deposit *deposit, uint64_t known_coin_id, const struct TALER_PaytoHashP *h_payto, - bool policy_blocked, struct GNUNET_TIME_Timestamp *exchange_timestamp, bool *balance_ok, bool *in_conflict); diff --git a/src/include/taler_extensions.h b/src/include/taler_extensions.h index d76de25e..4685464a 100644 --- a/src/include/taler_extensions.h +++ b/src/include/taler_extensions.h @@ -54,15 +54,6 @@ struct TALER_Extensions }; /* - * @brief Serial ID under which the policy details to an deposit are stored in - * the policy_details table. - */ -struct TALER_ExtensionsPolicySerialID -{ - struct GNUNET_HashCode hash; -}; - -/* * @brief Represents the implementation of an extension. * * An "Extension" is an optional feature for the Exchange. @@ -179,15 +170,17 @@ struct TALER_Extension * during a deposit request. * @param[out] serial On success, will contain the serial-ID under which the * exchange should save the policy_details in the deposit table. - * @param[out] deadline On sucess, set to the deadline until the policy must + * @param[out] deadline On success, set to the deadline until the policy must * be fulfilled. Might be "forever". This value is used by an external + * @param[out] error_hint On error, will contain a hint * mechanism to detect timeouts. * @return GNUNET_OK if the data was accepted by the extension. */ enum GNUNET_GenericReturnValue (*parse_policy_details)( const json_t *policy_details, - struct TALER_ExtensionsPolicySerialID *serial, - struct GNUNET_TIME_Timestamp *deadline); + struct GNUNET_HashCode *serial, + struct GNUNET_TIME_Timestamp *deadline, + const char **error_hint); /** * @brief Handler for POST-requests to the /policy/$name endpoint. Can be NULL. @@ -407,7 +400,7 @@ enum GNUNET_GenericReturnValue TALER_extensions_from_policy_details ( const json_t *policy_details, const struct TALER_Extension **extension, - char **error_hint); + const char **error_hint); /* * ================================ |
