aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_merchantdb_plugin.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-11 07:20:15 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-11 07:20:15 +0200
commit6299ac5c753a1f58e8729dd6cb19811844cea337 (patch)
tree6daba85c2048831c0ae39f789d3b154b914b5a9a /src/include/taler_merchantdb_plugin.h
parent43ae76f004b040f361c86402dd105da78a2aa960 (diff)
expand DB API to persist /keys
Diffstat (limited to 'src/include/taler_merchantdb_plugin.h')
-rw-r--r--src/include/taler_merchantdb_plugin.h94
1 files changed, 60 insertions, 34 deletions
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 54247d4c..81f9804b 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -956,9 +956,9 @@ typedef void
*/
typedef void
(*TALER_MERCHANTDB_RewardsCallback)(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);
/**
@@ -2666,13 +2666,13 @@ struct TALER_MERCHANTDB_Plugin
*/
enum TALER_ErrorCode
(*authorize_reward)(void *cls,
- const char *instance_id,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- const struct TALER_Amount *amount,
- const char *justification,
- const char *next_url,
- struct TALER_RewardIdentifierP *reward_id,
- struct GNUNET_TIME_Timestamp *expiration);
+ const char *instance_id,
+ const struct TALER_ReservePublicKeyP *reserve_pub,
+ const struct TALER_Amount *amount,
+ const char *justification,
+ const char *next_url,
+ struct TALER_RewardIdentifierP *reward_id,
+ struct GNUNET_TIME_Timestamp *expiration);
/**
@@ -2716,14 +2716,14 @@ struct TALER_MERCHANTDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*lookup_reward)(void *cls,
- const char *instance_id,
- const struct TALER_RewardIdentifierP *reward_id,
- struct TALER_Amount *total_authorized,
- struct TALER_Amount *total_picked_up,
- struct GNUNET_TIME_Timestamp *expiration,
- char **exchange_url,
- char **next_url,
- struct TALER_ReservePrivateKeyP *reserve_priv);
+ const char *instance_id,
+ const struct TALER_RewardIdentifierP *reward_id,
+ struct TALER_Amount *total_authorized,
+ struct TALER_Amount *total_picked_up,
+ struct GNUNET_TIME_Timestamp *expiration,
+ char **exchange_url,
+ char **next_url,
+ struct TALER_ReservePrivateKeyP *reserve_priv);
/**
@@ -2741,12 +2741,12 @@ struct TALER_MERCHANTDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*lookup_rewards)(void *cls,
- const char *instance_id,
- enum TALER_EXCHANGE_YesNoAll expired,
- int64_t limit,
- uint64_t offset,
- TALER_MERCHANTDB_RewardsCallback cb,
- void *cb_cls);
+ const char *instance_id,
+ enum TALER_EXCHANGE_YesNoAll expired,
+ int64_t limit,
+ uint64_t offset,
+ TALER_MERCHANTDB_RewardsCallback cb,
+ void *cb_cls);
/**
@@ -2767,16 +2767,16 @@ struct TALER_MERCHANTDB_Plugin
*/
enum GNUNET_DB_QueryStatus
(*lookup_reward_details)(void *cls,
- const char *instance_id,
- const struct TALER_RewardIdentifierP *reward_id,
- bool fpu,
- struct TALER_Amount *total_authorized,
- struct TALER_Amount *total_picked_up,
- char **justification,
- struct GNUNET_TIME_Timestamp *expiration,
- struct TALER_ReservePublicKeyP *reserve_pub,
- unsigned int *pickups_length,
- struct TALER_MERCHANTDB_PickupDetails **pickups);
+ const char *instance_id,
+ const struct TALER_RewardIdentifierP *reward_id,
+ bool fpu,
+ struct TALER_Amount *total_authorized,
+ struct TALER_Amount *total_picked_up,
+ char **justification,
+ struct GNUNET_TIME_Timestamp *expiration,
+ struct TALER_ReservePublicKeyP *reserve_pub,
+ unsigned int *pickups_length,
+ struct TALER_MERCHANTDB_PickupDetails **pickups);
/**
@@ -3100,6 +3100,32 @@ struct TALER_MERCHANTDB_Plugin
(*delete_pending_webhook)(void *cls,
uint64_t webhook_pending_serial);
+
+ /**
+ * Retrieve exchange's keys from the database.
+ *
+ * @param cls plugin closure
+ * @param exchange_url base URL of the exchange
+ * @param[out] keys set to the keys of the exchange
+ * @return transaction status
+ */
+ enum GNUNET_DB_QueryStatus
+ (*select_exchange_keys)(void *cls,
+ const char *exchange_url,
+ struct TALER_EXCHANGE_Keys **keys);
+
+
+ /**
+ * Insert or update @a keys into the database.
+ *
+ * @param cls plugin closure
+ * @param keys data to store
+ * @return transaction status
+ */
+ enum GNUNET_DB_QueryStatus
+ (*insert_exchange_keys)(void *cls,
+ const struct TALER_EXCHANGE_Keys *keys);
+
};
#endif