diff options
Diffstat (limited to 'src/include/taler_merchantdb_plugin.h')
-rw-r--r-- | src/include/taler_merchantdb_plugin.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h index 329975fa..aac39d17 100644 --- a/src/include/taler_merchantdb_plugin.h +++ b/src/include/taler_merchantdb_plugin.h @@ -1132,6 +1132,27 @@ struct TALER_MERCHANTDB_SpentTokenDetails /** + * Function called with information about a token that was used. + * + * @param cls closure + * @param spent_token_serial which used token is this about + * @param h_contract_terms hash of the contract terms this token was used on + * @param h_issue_pub hash of the token issue public key + * @param use_pub token use public key + * @param use_sig token use signature + * @param issue_sig unblinded token issue signature + */ +typedef void +(*TALER_MERCHANTDB_UsedTokensCallback)( + void *cls, + uint64_t spent_token_serial, + const struct TALER_PrivateContractHashP *h_contract_terms, + const struct TALER_TokenIssuePublicKeyHashP *h_issue_pub, + const struct TALER_TokenUsePublicKeyP *use_pub, + const struct TALER_TokenUseSignatureP *use_sig, + const struct TALER_TokenIssueSignatureP *issue_sig); + +/** * Handle to interact with the database. * * Functions ending with "_TR" run their OWN transaction scope @@ -2127,6 +2148,23 @@ struct TALER_MERCHANTDB_Plugin void *rc_cls); + + /** + * Retrieve details about tokens that were used for an order. + * + * @param cls closure + * @param order_serial identifies the order + * @param cb function to call for each used token + * @param cb_cls closure for @a cb + * @return transaction status + */ + enum GNUNET_DB_QueryStatus + (*lookup_spent_tokens_by_order) (void *cls, + uint64_t order_serial, + TALER_MERCHANTDB_UsedTokensCallback cb, + void *cb_cls); + + /** * Mark contract as paid and store the current @a session_id * for which the contract was paid. Deletes the underlying order |