merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 540c0dca94b827ad77e516b71588bbebb51f3136
parent af0d2a19f16421aacc3d2e814d8bb860d4780101
Author: Christian Blättler <blatc2@bfh.ch>
Date:   Sun, 15 Oct 2023 11:51:24 +0200

detail structs for token family, keys and spent tokens

Diffstat:
Msrc/include/taler_merchantdb_plugin.h | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 137 insertions(+), 0 deletions(-)

diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h @@ -1072,6 +1072,143 @@ struct TALER_MERCHANTDB_PickupDetails }; +/** + * Possible token family kinds. + */ +enum TALER_MERCHANTDB_TokenFamilyKind +{ + + /** + * Token family representing a discount token + */ + TALER_MERCHANTDB_TFK_Discount = 0, + + /** + * Token family representing a subscription token + */ + TALER_MERCHANTDB_TFK_Subscription = 1, + +}; + +/** + * Details about a token family. + */ +struct TALER_MERCHANTDB_TokenFamilyDetails +{ + /** + * User readable name of the token family. + */ + char* name; + + /** + * Description of the token family. + */ + char* description; + + /** + * Internationalized token family description. + */ + json_t *description_i18n; + + /** + * Validity duration of the token family. + */ + struct GNUNET_TIME_Relative duration; + + /** + * Token family kind. + */ + enum TALER_MERCHANTDB_TokenFamilyKind kind; + + /** + * Counter for each issued token of this family. + */ + */ + uint64_t issued; + + /** + * Counter for each redeemed token of this family. + */ + uint64_t redeemed; +} + + +/** + * Possible token key ciphers. + */ +enum TALER_MERCHANTDB_TokenFamilyKeyCipher +{ + + /** + * RSA based token key. + */ + TALER_MERCHANTDB_TFKC_RSA = 0, + + /** + * Schnorr based token key. + */ + TALER_MERCHANTDB_TFKC_CS = 1, + +}; + + +/** + * Details about a token key. + */ +struct TALER_MERCHANTDB_TokenFamilyKeyDetails +{ + /** + * Tokens signed with this key are valid from this date on. + */ + struct GNUNET_TIME_Timestamp start_date; + + /** + * Tokens signed with this key are valid until this date. + */ + struct GNUNET_TIME_Timestamp expiration_date; + + /** + * Token family public key. + */ + union TALER_TokenFamilyPublicKey pub; + + /** + * Hash of the token family public key. + */ + struct TALER_TokenFamilyPublicKeyHash pub_h; + + /** + * Token family private key. + */ + union TALER_TokenFamilyPrivateKey priv; + + /** + * Token family key cipher. + */ + enum TALER_MERCHANTDB_TokenKeyCipher cipher; +} + +/** + * Details about a spent token. +*/ +struct TALER_MERCHANTDB_SpentTokenDetails +{ + /** + * Public key of the spent token. + */ + struct TALER_TokenPublicKey pub; + + /** + * Signature that this token was spent on the specified order. + */ + struct TALER_TokenSignature sig; + + /** + * Blind signature for the spent token to prove validity of it. + */ + struct TALER_TokenBlindSignature blind_sig; +} + /** * Handle to interact with the database.