From db669ee495a29384c6d592cb1080db58e832a649 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 18 Jan 2020 23:49:37 +0100 Subject: payback -> recoup stranglers --- src/include/taler_auditordb_plugin.h | 52 +++---- src/include/taler_error_codes.h | 36 ++--- src/include/taler_exchange_service.h | 72 +++++----- src/include/taler_exchangedb_lib.h | 2 +- src/include/taler_exchangedb_plugin.h | 256 +++++++++++++++++----------------- src/include/taler_signatures.h | 46 +++--- src/include/taler_testing_lib.h | 12 +- 7 files changed, 238 insertions(+), 238 deletions(-) (limited to 'src/include') diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h index 4e444a8af..843cc4ca7 100644 --- a/src/include/taler_auditordb_plugin.h +++ b/src/include/taler_auditordb_plugin.h @@ -176,10 +176,10 @@ struct TALER_AUDITORDB_ProgressPointReserve uint64_t last_reserve_out_serial_id; /** - * serial ID of the last payback entry the auditor processed when + * serial ID of the last recoup entry the auditor processed when * considering reserves. */ - uint64_t last_reserve_payback_serial_id; + uint64_t last_reserve_recoup_serial_id; /** * serial ID of the last reserve_close @@ -246,14 +246,14 @@ struct TALER_AUDITORDB_ProgressPointCoin uint64_t last_refund_serial_id; /** - * Serial ID of the last payback operation the auditor processed. + * Serial ID of the last recoup operation the auditor processed. */ - uint64_t last_payback_serial_id; + uint64_t last_recoup_serial_id; /** - * Serial ID of the last payback-of-refresh operation the auditor processed. + * Serial ID of the last recoup-of-refresh operation the auditor processed. */ - uint64_t last_payback_refresh_serial_id; + uint64_t last_recoup_refresh_serial_id; }; @@ -1211,7 +1211,7 @@ struct TALER_AUDITORDB_Plugin * @param denom_balance value of coins outstanding with this denomination key * @param denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance) * @param denom_risk value of coins issued with this denomination key - * @param denom_payback value of coins paid back if this denomination key was revoked + * @param denom_recoup value of coins paid back if this denomination key was revoked * @param num_issued how many coins of this denomination did the exchange blind-sign * @return transaction status code */ @@ -1222,7 +1222,7 @@ struct TALER_AUDITORDB_Plugin const struct TALER_Amount *denom_balance, const struct TALER_Amount *denom_loss, const struct TALER_Amount *denom_risk, - const struct TALER_Amount *payback_loss, + const struct TALER_Amount *recoup_loss, uint64_t num_issued); @@ -1236,7 +1236,7 @@ struct TALER_AUDITORDB_Plugin * @param denom_balance value of coins outstanding with this denomination key * @param denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance) * @param denom_risk value of coins issued with this denomination key - * @param denom_payback value of coins paid back if this denomination key was revoked + * @param denom_recoup value of coins paid back if this denomination key was revoked * @param num_issued how many coins of this denomination did the exchange blind-sign * @return transaction status code */ @@ -1247,7 +1247,7 @@ struct TALER_AUDITORDB_Plugin const struct TALER_Amount *denom_balance, const struct TALER_Amount *denom_loss, const struct TALER_Amount *denom_risk, - const struct TALER_Amount *payback_loss, + const struct TALER_Amount *recoup_loss, uint64_t num_issued); @@ -1260,7 +1260,7 @@ struct TALER_AUDITORDB_Plugin * @param[out] denom_balance value of coins outstanding with this denomination key * @param[out] denom_loss value of coins redeemed that were not outstanding (effectively, negative @a denom_balance) * @param[out] denom_risk value of coins issued with this denomination key - * @param[out] denom_payback value of coins paid back if this denomination key was revoked + * @param[out] denom_recoup value of coins paid back if this denomination key was revoked * @param[out] num_issued how many coins of this denomination did the exchange blind-sign * @return transaction status code */ @@ -1271,7 +1271,7 @@ struct TALER_AUDITORDB_Plugin struct TALER_Amount *denom_balance, struct TALER_Amount *denom_loss, struct TALER_Amount *denom_risk, - struct TALER_Amount *payback_loss, + struct TALER_Amount *recoup_loss, uint64_t *num_issued); @@ -1301,8 +1301,8 @@ struct TALER_AUDITORDB_Plugin * @param melt_fee_balance total melt fees collected for this DK * @param refund_fee_balance total refund fees collected for this DK * @param risk maximum risk exposure of the exchange - * @param payback_loss actual losses from payback (actualized @a risk) - * @param irregular_paybacks paybacks made of non-revoked coins (reduces + * @param recoup_loss actual losses from recoup (actualized @a risk) + * @param irregular_recoups recoups made of non-revoked coins (reduces * risk, but should never happen) * @return transaction status code */ @@ -1315,8 +1315,8 @@ struct TALER_AUDITORDB_Plugin const struct TALER_Amount *melt_fee_balance, const struct TALER_Amount *refund_fee_balance, const struct TALER_Amount *risk, - const struct TALER_Amount *payback_loss, - const struct TALER_Amount *irregular_paybacks); + const struct TALER_Amount *recoup_loss, + const struct TALER_Amount *irregular_recoups); /** @@ -1331,8 +1331,8 @@ struct TALER_AUDITORDB_Plugin * @param melt_fee_balance total melt fees collected for this DK * @param refund_fee_balance total refund fees collected for this DK * @param risk maximum risk exposure of the exchange - * @param payback_loss actual losses from payback (actualized @a risk) - * @param irregular_paybacks paybacks made of non-revoked coins (reduces + * @param recoup_loss actual losses from recoup (actualized @a risk) + * @param irregular_recoups recoups made of non-revoked coins (reduces * risk, but should never happen) * @return transaction status code */ @@ -1345,8 +1345,8 @@ struct TALER_AUDITORDB_Plugin const struct TALER_Amount *melt_fee_balance, const struct TALER_Amount *refund_fee_balance, const struct TALER_Amount *risk, - const struct TALER_Amount *payback_loss, - const struct TALER_Amount *irregular_paybacks); + const struct TALER_Amount *recoup_loss, + const struct TALER_Amount *irregular_recoups); /** @@ -1360,8 +1360,8 @@ struct TALER_AUDITORDB_Plugin * @param[out] melt_fee_balance total melt fees collected for this DK * @param[out] refund_fee_balance total refund fees collected for this DK * @param[out] risk maximum risk exposure of the exchange - * @param[out] payback_loss actual losses from payback (actualized @a risk) - * @param[out] irregular_paybacks paybacks made of non-revoked coins (reduces + * @param[out] recoup_loss actual losses from recoup (actualized @a risk) + * @param[out] irregular_recoups recoups made of non-revoked coins (reduces * risk, but should never happen) * @return transaction status code */ @@ -1374,8 +1374,8 @@ struct TALER_AUDITORDB_Plugin struct TALER_Amount *melt_fee_balance, struct TALER_Amount *refund_fee_balance, struct TALER_Amount *risk, - struct TALER_Amount *payback_loss, - struct TALER_Amount *irregular_payback); + struct TALER_Amount *recoup_loss, + struct TALER_Amount *irregular_recoup); /** @@ -1390,7 +1390,7 @@ struct TALER_AUDITORDB_Plugin * @param revenue_balance what was the total profit made from * deposit fees, melting fees, refresh fees * and coins that were never returned? - * @param payback_loss_balance total losses from paybacks of revoked denominations + * @param recoup_loss_balance total losses from recoups of revoked denominations * @return transaction status code */ enum GNUNET_DB_QueryStatus @@ -1403,7 +1403,7 @@ struct TALER_AUDITORDB_Plugin revenue_timestamp, const struct TALER_Amount *revenue_balance, const struct - TALER_Amount *payback_loss_balance); + TALER_Amount *recoup_loss_balance); /** diff --git a/src/include/taler_error_codes.h b/src/include/taler_error_codes.h index d1b886d7f..3833e7a4e 100644 --- a/src/include/taler_error_codes.h +++ b/src/include/taler_error_codes.h @@ -148,7 +148,7 @@ enum TALER_ErrorCode /** * The exchange failed to obtain the transaction history of the given * coin from the database while generating an insufficient funds - * errors. This can happen during /deposit or /payback requests. This + * errors. This can happen during /deposit or /recoup requests. This * response is provided with HTTP status code * MHD_HTTP_INTERNAL_SERVER_ERROR. */ @@ -505,7 +505,7 @@ enum TALER_ErrorCode /** * The denomination of the given coin has past its expiration date and * it is also not a valid zombie (that is, was not refreshed with the - * fresh coin being subjected to payback). + * fresh coin being subjected to recoup). */ TALER_EC_REFRESH_MELT_COIN_EXPIRED_NO_ZOMBIE = 1309, @@ -514,19 +514,19 @@ enum TALER_ErrorCode * sign the melted zombie coin. This response is provided with HTTP * status code MHD_HTTP_NOT_FOUND. */ - TALER_EC_REFRESH_PAYBACK_DENOMINATION_KEY_NOT_FOUND = 1351, + TALER_EC_REFRESH_RECOUP_DENOMINATION_KEY_NOT_FOUND = 1351, /** * Validity period of the denomination key is in the future. Returned * with an HTTP status of #MHD_HTTP_PRECONDITION_FAILED. */ - TALER_EC_REFRESH_PAYBACK_DENOMINATION_VALIDITY_IN_FUTURE = 1352, + TALER_EC_REFRESH_RECOUP_DENOMINATION_VALIDITY_IN_FUTURE = 1352, /** * Denomination key of the coin is past the deposit deadline. * Returned with an HTTP status of #MHD_HTTP_GONE. */ - TALER_EC_REFRESH_PAYBACK_DENOMINATION_EXPIRED = 1353, + TALER_EC_REFRESH_RECOUP_DENOMINATION_EXPIRED = 1353, /** * Denomination key of the coin is past the deposit deadline. @@ -841,79 +841,79 @@ enum TALER_ErrorCode TALER_EC_TRACK_TRANSACTION_MERCHANT_SIGNATURE_INVALID = 1804, /** - * The given denomination key is not in the "payback" set of the + * The given denomination key is not in the "recoup" set of the * exchange right now. This response is provided with an HTTP status * code of MHD_HTTP_NOT_FOUND. */ - TALER_EC_PAYBACK_DENOMINATION_KEY_UNKNOWN = 1850, + TALER_EC_RECOUP_DENOMINATION_KEY_UNKNOWN = 1850, /** * The given coin signature is invalid for the request. This response * is provided with an HTTP status code of MHD_HTTP_FORBIDDEN. */ - TALER_EC_PAYBACK_SIGNATURE_INVALID = 1851, + TALER_EC_RECOUP_SIGNATURE_INVALID = 1851, /** * The signature of the denomination key over the coin is not valid. * This response is provided with HTTP status code * MHD_HTTP_BAD_REQUEST. */ - TALER_EC_PAYBACK_DENOMINATION_SIGNATURE_INVALID = 1852, + TALER_EC_RECOUP_DENOMINATION_SIGNATURE_INVALID = 1852, /** * The exchange failed to access its own database about reserves. This * response is provided with HTTP status code * MHD_HTTP_INTERNAL_SERVER_ERROR. */ - TALER_EC_PAYBACK_DB_FETCH_FAILED = 1853, + TALER_EC_RECOUP_DB_FETCH_FAILED = 1853, /** * The exchange could not find the corresponding withdraw operation. * The request is denied. This response is provided with an HTTP * status code of MHD_HTTP_NOT_FOUND. */ - TALER_EC_PAYBACK_WITHDRAW_NOT_FOUND = 1854, + TALER_EC_RECOUP_WITHDRAW_NOT_FOUND = 1854, /** * The exchange obtained an internally inconsistent transaction * history for the given coin. This response is provided with HTTP * status code MHD_HTTP_INTERNAL_SERVER_ERROR. */ - TALER_EC_PAYBACK_HISTORY_DB_ERROR = 1855, + TALER_EC_RECOUP_HISTORY_DB_ERROR = 1855, /** - * The exchange failed to store information about the payback to be + * The exchange failed to store information about the recoup to be * performed in the database. This response is provided with HTTP * status code MHD_HTTP_INTERNAL_SERVER_ERROR. */ - TALER_EC_PAYBACK_DB_PUT_FAILED = 1856, + TALER_EC_RECOUP_DB_PUT_FAILED = 1856, /** * The coin's remaining balance is zero. The request is denied. This * response is provided with an HTTP status code of * MHD_HTTP_FORBIDDEN. */ - TALER_EC_PAYBACK_COIN_BALANCE_ZERO = 1857, + TALER_EC_RECOUP_COIN_BALANCE_ZERO = 1857, /** * The exchange failed to reproduce the coin's blinding. This response * is provided with an HTTP status code of * MHD_HTTP_INTERNAL_SERVER_ERROR. */ - TALER_EC_PAYBACK_BLINDING_FAILED = 1858, + TALER_EC_RECOUP_BLINDING_FAILED = 1858, /** * The coin's remaining balance is zero. The request is denied. This * response is provided with an HTTP status code of * MHD_HTTP_INTERNAL_SERVER_ERROR */ - TALER_EC_PAYBACK_COIN_BALANCE_NEGATIVE = 1859, + TALER_EC_RECOUP_COIN_BALANCE_NEGATIVE = 1859, /** * Validity period of the denomination key is in the future. Returned * with an HTTP status of #MHD_HTTP_PRECONDITION_FAILED. */ - TALER_EC_PAYBACK_DENOMINATION_VALIDITY_IN_FUTURE = 1860, + TALER_EC_RECOUP_DENOMINATION_VALIDITY_IN_FUTURE = 1860, /** * The "have" parameter was not a natural number. This reponse is diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 5834d2a6f..1c29e15c1 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -965,9 +965,9 @@ enum TALER_EXCHANGE_ReserveTransactionType TALER_EXCHANGE_RTT_WITHDRAWAL, /** - * /payback operation. + * /recoup operation. */ - TALER_EXCHANGE_RTT_PAYBACK, + TALER_EXCHANGE_RTT_RECOUP, /** * Reserve closed operation. @@ -1034,8 +1034,8 @@ struct TALER_EXCHANGE_ReserveHistory json_t *out_authorization_sig; /** - * Information provided if the reserve was filled via /payback. - * @e type is #TALER_EXCHANGE_RTT_PAYBACK. + * Information provided if the reserve was filled via /recoup. + * @e type is #TALER_EXCHANGE_RTT_RECOUP. */ struct { @@ -1047,7 +1047,7 @@ struct TALER_EXCHANGE_ReserveHistory /** * Signature of the coin of type - * #TALER_SIGNATURE_EXCHANGE_CONFIRM_PAYBACK. + * #TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP. */ struct TALER_ExchangeSignatureP exchange_sig; @@ -1057,11 +1057,11 @@ struct TALER_EXCHANGE_ReserveHistory struct TALER_ExchangePublicKeyP exchange_pub; /** - * When did the /payback operation happen? + * When did the /recoup operation happen? */ struct GNUNET_TIME_Absolute timestamp; - } payback_details; + } recoup_details; /** * Information about a close operation of the reserve. @@ -1722,13 +1722,13 @@ TALER_EXCHANGE_verify_coin_history (const struct struct TALER_Amount *total); -/* ********************* /payback *********************** */ +/* ********************* /recoup *********************** */ /** - * @brief A /payback Handle + * @brief A /recoup Handle */ -struct TALER_EXCHANGE_PaybackHandle; +struct TALER_EXCHANGE_RecoupHandle; /** @@ -1745,27 +1745,27 @@ struct TALER_EXCHANGE_PaybackHandle; * @param ec taler-specific error code, #TALER_EC_NONE on success * @param amount amount the exchange will wire back for this coin, * on error the total balance remaining, or NULL - * @param timestamp what time did the exchange receive the /payback request - * @param reserve_pub public key of the reserve receiving the payback, NULL if refreshed or on error + * @param timestamp what time did the exchange receive the /recoup request + * @param reserve_pub public key of the reserve receiving the recoup, NULL if refreshed or on error * @param old_coin_pub public key of the dirty coin, NULL if not refreshed or on error * @param full_response full response from the exchange (for logging, in case of errors) */ typedef void -(*TALER_EXCHANGE_PaybackResultCallback) (void *cls, - unsigned int http_status, - enum TALER_ErrorCode ec, - const struct TALER_Amount *amount, - struct GNUNET_TIME_Absolute timestamp, - const struct - TALER_ReservePublicKeyP *reserve_pub, - const struct - TALER_CoinSpendPublicKeyP *old_coin_pub, - const json_t *full_response); +(*TALER_EXCHANGE_RecoupResultCallback) (void *cls, + unsigned int http_status, + enum TALER_ErrorCode ec, + const struct TALER_Amount *amount, + struct GNUNET_TIME_Absolute timestamp, + const struct + TALER_ReservePublicKeyP *reserve_pub, + const struct + TALER_CoinSpendPublicKeyP *old_coin_pub, + const json_t *full_response); /** * Ask the exchange to pay back a coin due to the exchange triggering - * the emergency payback protocol for a given denomination. The value + * the emergency recoup protocol for a given denomination. The value * of the coin will be refunded to the original customer (without fees). * * @param exchange the exchange handle; the exchange must be ready to operate @@ -1773,30 +1773,30 @@ typedef void * @param denom_sig signature over the coin by the exchange using @a pk * @param ps secret internals of the original planchet * @param was_refreshed #GNUNET_YES if the coin in @a ps was refreshed - * @param payback_cb the callback to call when the final result for this request is available - * @param payback_cb_cls closure for @a payback_cb + * @param recoup_cb the callback to call when the final result for this request is available + * @param recoup_cb_cls closure for @a recoup_cb * @return NULL * if the inputs are invalid (i.e. denomination key not with this exchange). * In this case, the callback is not called. */ -struct TALER_EXCHANGE_PaybackHandle * -TALER_EXCHANGE_payback (struct TALER_EXCHANGE_Handle *exchange, - const struct TALER_EXCHANGE_DenomPublicKey *pk, - const struct TALER_DenominationSignature *denom_sig, - const struct TALER_PlanchetSecretsP *ps, - int was_refreshed, - TALER_EXCHANGE_PaybackResultCallback payback_cb, - void *payback_cb_cls); +struct TALER_EXCHANGE_RecoupHandle * +TALER_EXCHANGE_recoup (struct TALER_EXCHANGE_Handle *exchange, + const struct TALER_EXCHANGE_DenomPublicKey *pk, + const struct TALER_DenominationSignature *denom_sig, + const struct TALER_PlanchetSecretsP *ps, + int was_refreshed, + TALER_EXCHANGE_RecoupResultCallback recoup_cb, + void *recoup_cb_cls); /** - * Cancel a payback request. This function cannot be used on a + * Cancel a recoup request. This function cannot be used on a * request handle if the callback was already invoked. * - * @param ph the payback handle + * @param ph the recoup handle */ void -TALER_EXCHANGE_payback_cancel (struct TALER_EXCHANGE_PaybackHandle *ph); +TALER_EXCHANGE_recoup_cancel (struct TALER_EXCHANGE_RecoupHandle *ph); #endif /* _TALER_EXCHANGE_SERVICE_H */ diff --git a/src/include/taler_exchangedb_lib.h b/src/include/taler_exchangedb_lib.h index f820d1a25..67097fd14 100644 --- a/src/include/taler_exchangedb_lib.h +++ b/src/include/taler_exchangedb_lib.h @@ -169,7 +169,7 @@ TALER_EXCHANGEDB_revocations_iterate (const char *revocation_dir, /** * Mark the given denomination key as revoked and request the wallets - * to initiate /payback. + * to initiate /recoup. * * @param revocation_dir where to write the revocation certificate * @param denom_hash hash of the denomination key to revoke diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h index 27dcc3440..b3c4fd804 100644 --- a/src/include/taler_exchangedb_plugin.h +++ b/src/include/taler_exchangedb_plugin.h @@ -275,10 +275,10 @@ struct TALER_EXCHANGEDB_CollectableBlindcoin /** - * Information the exchange records about a /payback request + * Information the exchange records about a /recoup request * in a reserve history. */ -struct TALER_EXCHANGEDB_Payback +struct TALER_EXCHANGEDB_Recoup { /** @@ -294,7 +294,7 @@ struct TALER_EXCHANGEDB_Payback /** * Signature of the coin of type - * #TALER_SIGNATURE_WALLET_COIN_PAYBACK. + * #TALER_SIGNATURE_WALLET_COIN_RECOUP. */ struct TALER_CoinSpendSignatureP coin_sig; @@ -309,7 +309,7 @@ struct TALER_EXCHANGEDB_Payback struct TALER_Amount value; /** - * When did the /payback operation happen? + * When did the /recoup operation happen? */ struct GNUNET_TIME_Absolute timestamp; @@ -317,10 +317,10 @@ struct TALER_EXCHANGEDB_Payback /** - * Information the exchange records about a /payback request + * Information the exchange records about a /recoup request * in a coin history. */ -struct TALER_EXCHANGEDB_PaybackListEntry +struct TALER_EXCHANGEDB_RecoupListEntry { /** @@ -331,7 +331,7 @@ struct TALER_EXCHANGEDB_PaybackListEntry /** * Signature of the coin of type - * #TALER_SIGNATURE_WALLET_COIN_PAYBACK. + * #TALER_SIGNATURE_WALLET_COIN_RECOUP. */ struct TALER_CoinSpendSignatureP coin_sig; @@ -346,7 +346,7 @@ struct TALER_EXCHANGEDB_PaybackListEntry struct TALER_Amount value; /** - * When did the /payback operation happen? + * When did the /recoup operation happen? */ struct GNUNET_TIME_Absolute timestamp; @@ -354,10 +354,10 @@ struct TALER_EXCHANGEDB_PaybackListEntry /** - * Information the exchange records about a /payback-refresh request in + * Information the exchange records about a /recoup-refresh request in * a coin transaction history. */ -struct TALER_EXCHANGEDB_PaybackRefreshListEntry +struct TALER_EXCHANGEDB_RecoupRefreshListEntry { /** @@ -374,7 +374,7 @@ struct TALER_EXCHANGEDB_PaybackRefreshListEntry /** * Signature of the coin of type - * #TALER_SIGNATURE_WALLET_COIN_PAYBACK. + * #TALER_SIGNATURE_WALLET_COIN_RECOUP. */ struct TALER_CoinSpendSignatureP coin_sig; @@ -389,7 +389,7 @@ struct TALER_EXCHANGEDB_PaybackRefreshListEntry struct TALER_Amount value; /** - * When did the /payback operation happen? + * When did the /recoup operation happen? */ struct GNUNET_TIME_Absolute timestamp; @@ -413,9 +413,9 @@ enum TALER_EXCHANGEDB_ReserveOperation TALER_EXCHANGEDB_RO_WITHDRAW_COIN = 1, /** - * A coin was returned to the reserve using /payback. + * A coin was returned to the reserve using /recoup. */ - TALER_EXCHANGEDB_RO_PAYBACK_COIN = 2, + TALER_EXCHANGEDB_RO_RECOUP_COIN = 2, /** * The exchange send inactive funds back from the reserve to the @@ -463,9 +463,9 @@ struct TALER_EXCHANGEDB_ReserveHistory struct TALER_EXCHANGEDB_CollectableBlindcoin *withdraw; /** - * Details about a /payback operation. + * Details about a /recoup operation. */ - struct TALER_EXCHANGEDB_Payback *payback; + struct TALER_EXCHANGEDB_Recoup *recoup; /** * Details about a bank transfer from the exchange (reserve @@ -875,19 +875,19 @@ enum TALER_EXCHANGEDB_TransactionType TALER_EXCHANGEDB_TT_REFUND = 2, /** - * /payback-refresh operation (on the old coin, adding to the old coin's value) + * /recoup-refresh operation (on the old coin, adding to the old coin's value) */ - TALER_EXCHANGEDB_TT_OLD_COIN_PAYBACK = 3, + TALER_EXCHANGEDB_TT_OLD_COIN_RECOUP = 3, /** - * /payback operation. + * /recoup operation. */ - TALER_EXCHANGEDB_TT_PAYBACK = 4, + TALER_EXCHANGEDB_TT_RECOUP = 4, /** - * /payback-refresh operation (on the new coin, eliminating its value) + * /recoup-refresh operation (on the new coin, eliminating its value) */ - TALER_EXCHANGEDB_TT_PAYBACK_REFRESH = 5 + TALER_EXCHANGEDB_TT_RECOUP_REFRESH = 5 }; @@ -938,24 +938,24 @@ struct TALER_EXCHANGEDB_TransactionList struct TALER_EXCHANGEDB_RefundListEntry *refund; /** - * Details if transaction was a /payback-refund operation where + * Details if transaction was a /recoup-refund operation where * this coin was the OLD coin. - * (#TALER_EXCHANGEDB_TT_OLD_COIN_PAYBACK). + * (#TALER_EXCHANGEDB_TT_OLD_COIN_RECOUP). */ - struct TALER_EXCHANGEDB_PaybackRefreshListEntry *old_coin_payback; + struct TALER_EXCHANGEDB_RecoupRefreshListEntry *old_coin_recoup; /** - * Details if transaction was a /payback operation. - * (#TALER_EXCHANGEDB_TT_PAYBACK) + * Details if transaction was a /recoup operation. + * (#TALER_EXCHANGEDB_TT_RECOUP) */ - struct TALER_EXCHANGEDB_PaybackListEntry *payback; + struct TALER_EXCHANGEDB_RecoupListEntry *recoup; /** - * Details if transaction was a /payback-refund operation where + * Details if transaction was a /recoup-refund operation where * this coin was the REFRESHED coin. - * (#TALER_EXCHANGEDB_TT_PAYBACK_REFRESH) + * (#TALER_EXCHANGEDB_TT_RECOUP_REFRESH) */ - struct TALER_EXCHANGEDB_PaybackRefreshListEntry *payback_refresh; + struct TALER_EXCHANGEDB_RecoupRefreshListEntry *recoup_refresh; } details; @@ -1373,67 +1373,67 @@ typedef int /** - * Function called about paybacks the exchange has to perform. + * Function called about recoups the exchange has to perform. * * @param cls closure - * @param rowid row identifier used to uniquely identify the payback operation - * @param timestamp when did we receive the payback request + * @param rowid row identifier used to uniquely identify the recoup operation + * @param timestamp when did we receive the recoup request * @param amount how much should be added back to the reserve * @param reserve_pub public key of the reserve * @param coin public information about the coin - * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_PAYBACK + * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP * @param coin_blind blinding factor used to blind the coin * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop */ typedef int -(*TALER_EXCHANGEDB_PaybackCallback)(void *cls, - uint64_t rowid, - struct GNUNET_TIME_Absolute timestamp, - const struct TALER_Amount *amount, - const struct - TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_CoinPublicInfo *coin, - const struct - TALER_DenominationPublicKey *denom_pub, - const struct - TALER_CoinSpendSignatureP *coin_sig, - const struct - TALER_DenominationBlindingKeyP *coin_blind); +(*TALER_EXCHANGEDB_RecoupCallback)(void *cls, + uint64_t rowid, + struct GNUNET_TIME_Absolute timestamp, + const struct TALER_Amount *amount, + const struct + TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_CoinPublicInfo *coin, + const struct + TALER_DenominationPublicKey *denom_pub, + const struct + TALER_CoinSpendSignatureP *coin_sig, + const struct + TALER_DenominationBlindingKeyP *coin_blind); /** - * Function called about paybacks on refreshed coins the exchange has to + * Function called about recoups on refreshed coins the exchange has to * perform. * * @param cls closure - * @param rowid row identifier used to uniquely identify the payback operation - * @param timestamp when did we receive the payback request + * @param rowid row identifier used to uniquely identify the recoup operation + * @param timestamp when did we receive the recoup request * @param amount how much should be added back to the reserve * @param old_coin_pub original coin that was refreshed to create @a coin * @param coin public information about the coin - * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_PAYBACK + * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP * @param coin_blind blinding factor used to blind the coin * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop */ typedef int -(*TALER_EXCHANGEDB_PaybackRefreshCallback)(void *cls, - uint64_t rowid, - struct GNUNET_TIME_Absolute - timestamp, - const struct TALER_Amount *amount, - const struct - TALER_CoinSpendPublicKeyP * - old_coin_pub, - const struct - TALER_CoinPublicInfo *coin, - const struct - TALER_DenominationPublicKey * - denom_pub, - const struct - TALER_CoinSpendSignatureP *coin_sig, - const struct - TALER_DenominationBlindingKeyP * - coin_blind); +(*TALER_EXCHANGEDB_RecoupRefreshCallback)(void *cls, + uint64_t rowid, + struct GNUNET_TIME_Absolute + timestamp, + const struct TALER_Amount *amount, + const struct + TALER_CoinSpendPublicKeyP * + old_coin_pub, + const struct + TALER_CoinPublicInfo *coin, + const struct + TALER_DenominationPublicKey * + denom_pub, + const struct + TALER_CoinSpendSignatureP *coin_sig, + const struct + TALER_DenominationBlindingKeyP * + coin_blind); /** @@ -1487,32 +1487,32 @@ typedef enum GNUNET_DB_QueryStatus /** - * Function called with information justifying an aggregate payback. - * (usually implemented by the auditor when verifying losses from paybacks). + * Function called with information justifying an aggregate recoup. + * (usually implemented by the auditor when verifying losses from recoups). * * @param cls closure - * @param rowid row identifier used to uniquely identify the payback operation + * @param rowid row identifier used to uniquely identify the recoup operation * @param coin information about the coin - * @param coin_sig signature of the coin of type #TALER_SIGNATURE_WALLET_COIN_PAYBACK + * @param coin_sig signature of the coin of type #TALER_SIGNATURE_WALLET_COIN_RECOUP * @param coin_blind blinding key of the coin * @param h_blind_ev blinded envelope, as calculated by the exchange * @param amount total amount to be paid back */ typedef void -(*TALER_EXCHANGEDB_PaybackJustificationCallback)(void *cls, - uint64_t rowid, - const struct - TALER_CoinPublicInfo *coin, - const struct - TALER_CoinSpendSignatureP * - coin_sig, - const struct - TALER_DenominationBlindingKeyP - *coin_blind, - const struct - GNUNET_HashCode *h_blinded_ev, - const struct - TALER_Amount *amount); +(*TALER_EXCHANGEDB_RecoupJustificationCallback)(void *cls, + uint64_t rowid, + const struct + TALER_CoinPublicInfo *coin, + const struct + TALER_CoinSpendSignatureP * + coin_sig, + const struct + TALER_DenominationBlindingKeyP + *coin_blind, + const struct + GNUNET_HashCode *h_blinded_ev, + const struct + TALER_Amount *amount); /** @@ -2192,7 +2192,7 @@ struct TALER_EXCHANGEDB_Plugin * @param cls the @e cls of this struct with the plugin-specific state * @param session database connection * @param coin_pub coin to investigate - * @param include_payback include payback transactions of the coin? + * @param include_recoup include recoup transactions of the coin? * @param[out] tlp set to list of transactions, NULL if coin is fresh * @return database transaction status */ @@ -2200,7 +2200,7 @@ struct TALER_EXCHANGEDB_Plugin (*get_coin_transactions)(void *cls, struct TALER_EXCHANGEDB_Session *session, const struct TALER_CoinSpendPublicKeyP *coin_pub, - int include_payback, + int include_recoup, struct TALER_EXCHANGEDB_TransactionList **tlp); @@ -2630,7 +2630,7 @@ struct TALER_EXCHANGEDB_Plugin /** - * Function called to select payback requests the exchange + * Function called to select recoup requests the exchange * received, ordered by serial ID (monotonically increasing). * * @param cls closure @@ -2641,15 +2641,15 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_payback_above_serial_id)(void *cls, - struct TALER_EXCHANGEDB_Session *session, - uint64_t serial_id, - TALER_EXCHANGEDB_PaybackCallback cb, - void *cb_cls); + (*select_recoup_above_serial_id)(void *cls, + struct TALER_EXCHANGEDB_Session *session, + uint64_t serial_id, + TALER_EXCHANGEDB_RecoupCallback cb, + void *cb_cls); /** - * Function called to select payback requests the exchange received for + * Function called to select recoup requests the exchange received for * refreshed coins, ordered by serial ID (monotonically increasing). * * @param cls closure @@ -2660,13 +2660,13 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction status code */ enum GNUNET_DB_QueryStatus - (*select_payback_refresh_above_serial_id)(void *cls, - struct TALER_EXCHANGEDB_Session * - session, - uint64_t serial_id, - TALER_EXCHANGEDB_PaybackRefreshCallback - cb, - void *cb_cls); + (*select_recoup_refresh_above_serial_id)(void *cls, + struct TALER_EXCHANGEDB_Session * + session, + uint64_t serial_id, + TALER_EXCHANGEDB_RecoupRefreshCallback + cb, + void *cb_cls); /** @@ -2691,14 +2691,14 @@ struct TALER_EXCHANGEDB_Plugin /** - * Function called to add a request for an emergency payback for a + * Function called to add a request for an emergency recoup for a * coin. The funds are to be added back to the reserve. * * @param cls closure * @param session database connection * @param reserve_pub public key of the reserve that is being refunded * @param coin public information about a coin - * @param coin_sig signature of the coin of type #TALER_SIGNATURE_WALLET_COIN_PAYBACK + * @param coin_sig signature of the coin of type #TALER_SIGNATURE_WALLET_COIN_RECOUP * @param coin_blind blinding key of the coin * @param h_blind_ev blinded envelope, as calculated by the exchange * @param amount total amount to be paid back @@ -2707,26 +2707,26 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction result status */ enum GNUNET_DB_QueryStatus - (*insert_payback_request)(void *cls, - struct TALER_EXCHANGEDB_Session *session, - const struct TALER_ReservePublicKeyP *reserve_pub, - const struct TALER_CoinPublicInfo *coin, - const struct TALER_CoinSpendSignatureP *coin_sig, - const struct - TALER_DenominationBlindingKeyP *coin_blind, - const struct TALER_Amount *amount, - const struct GNUNET_HashCode *h_blind_ev, - struct GNUNET_TIME_Absolute timestamp); + (*insert_recoup_request)(void *cls, + struct TALER_EXCHANGEDB_Session *session, + const struct TALER_ReservePublicKeyP *reserve_pub, + const struct TALER_CoinPublicInfo *coin, + const struct TALER_CoinSpendSignatureP *coin_sig, + const struct + TALER_DenominationBlindingKeyP *coin_blind, + const struct TALER_Amount *amount, + const struct GNUNET_HashCode *h_blind_ev, + struct GNUNET_TIME_Absolute timestamp); /** - * Function called to add a request for an emergency payback for a + * Function called to add a request for an emergency recoup for a * refreshed coin. The funds are to be added back to the original coin. * * @param cls closure * @param session database connection * @param coin public information about the refreshed coin - * @param coin_sig signature of the coin of type #TALER_SIGNATURE_WALLET_COIN_PAYBACK + * @param coin_sig signature of the coin of type #TALER_SIGNATURE_WALLET_COIN_RECOUP * @param coin_blind blinding key of the coin * @param h_blind_ev blinded envelope, as calculated by the exchange * @param amount total amount to be paid back @@ -2735,16 +2735,16 @@ struct TALER_EXCHANGEDB_Plugin * @return transaction result status */ enum GNUNET_DB_QueryStatus - (*insert_payback_refresh_request)(void *cls, - struct TALER_EXCHANGEDB_Session *session, - const struct TALER_CoinPublicInfo *coin, - const struct - TALER_CoinSpendSignatureP *coin_sig, - const struct - TALER_DenominationBlindingKeyP *coin_blind, - const struct TALER_Amount *amount, - const struct GNUNET_HashCode *h_blind_ev, - struct GNUNET_TIME_Absolute timestamp); + (*insert_recoup_refresh_request)(void *cls, + struct TALER_EXCHANGEDB_Session *session, + const struct TALER_CoinPublicInfo *coin, + const struct + TALER_CoinSpendSignatureP *coin_sig, + const struct + TALER_DenominationBlindingKeyP *coin_blind, + const struct TALER_Amount *amount, + const struct GNUNET_HashCode *h_blind_ev, + struct GNUNET_TIME_Absolute timestamp); /** diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h index 75735bb1f..8edfcc6d8 100644 --- a/src/include/taler_signatures.h +++ b/src/include/taler_signatures.h @@ -115,9 +115,9 @@ #define TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND 1038 /** - * Signature where the Exchange confirms a payback. + * Signature where the Exchange confirms a recoup. */ -#define TALER_SIGNATURE_EXCHANGE_CONFIRM_PAYBACK 1039 +#define TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP 1039 /** * Signature where the Exchange confirms it closed a reserve. @@ -125,9 +125,9 @@ #define TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED 1040 /** - * Signature where the Exchange confirms a payback-refresh operation. + * Signature where the Exchange confirms a recoup-refresh operation. */ -#define TALER_SIGNATURE_EXCHANGE_CONFIRM_PAYBACK_REFRESH 1041 +#define TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH 1041 /**********************/ @@ -205,9 +205,9 @@ #define TALER_SIGNATURE_WALLET_COIN_MELT 1202 /** - * Signature using a coin key requesting payback. + * Signature using a coin key requesting recoup. */ -#define TALER_SIGNATURE_WALLET_COIN_PAYBACK 1203 +#define TALER_SIGNATURE_WALLET_COIN_RECOUP 1203 /** * Signature using a coin key authenticating link data. @@ -1223,13 +1223,13 @@ struct TALER_ConfirmWirePS /** * Signed data to request that a coin should be refunded as part of - * the "emergency" /payback protocol. The refund will go back to the bank + * the "emergency" /recoup protocol. The refund will go back to the bank * account that created the reserve. */ -struct TALER_PaybackRequestPS +struct TALER_RecoupRequestPS { /** - * Purpose is #TALER_SIGNATURE_WALLET_COIN_PAYBACK + * Purpose is #TALER_SIGNATURE_WALLET_COIN_RECOUP */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; @@ -1252,20 +1252,20 @@ struct TALER_PaybackRequestPS /** * Response by which the exchange affirms that it will - * refund a coin as part of the emergency /payback - * protocol. The payback will go back to the bank + * refund a coin as part of the emergency /recoup + * protocol. The recoup will go back to the bank * account that created the reserve. */ -struct TALER_PaybackConfirmationPS +struct TALER_RecoupConfirmationPS { /** - * Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_PAYBACK + * Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; /** - * When did the exchange receive the payback request? + * When did the exchange receive the recoup request? * Indirectly determines when the wire transfer is (likely) * to happen. */ @@ -1275,7 +1275,7 @@ struct TALER_PaybackConfirmationPS * How much of the coin's value will the exchange transfer? * (Needed in case the coin was partially spent.) */ - struct TALER_AmountNBO payback_amount; + struct TALER_AmountNBO recoup_amount; /** * Public key of the coin. @@ -1283,7 +1283,7 @@ struct TALER_PaybackConfirmationPS struct TALER_CoinSpendPublicKeyP coin_pub; /** - * Public key of the reserve that will receive the payback. + * Public key of the reserve that will receive the recoup. */ struct TALER_ReservePublicKeyP reserve_pub; }; @@ -1291,19 +1291,19 @@ struct TALER_PaybackConfirmationPS /** * Response by which the exchange affirms that it will refund a refreshed coin - * as part of the emergency /payback protocol. The payback will go back to the + * as part of the emergency /recoup protocol. The recoup will go back to the * old coin's balance. */ -struct TALER_PaybackRefreshConfirmationPS +struct TALER_RecoupRefreshConfirmationPS { /** - * Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_PAYBACK_REFRESH + * Purpose is #TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP_REFRESH */ struct GNUNET_CRYPTO_EccSignaturePurpose purpose; /** - * When did the exchange receive the payback request? + * When did the exchange receive the recoup request? * Indirectly determines when the wire transfer is (likely) * to happen. */ @@ -1313,7 +1313,7 @@ struct TALER_PaybackRefreshConfirmationPS * How much of the coin's value will the exchange transfer? * (Needed in case the coin was partially spent.) */ - struct TALER_AmountNBO payback_amount; + struct TALER_AmountNBO recoup_amount; /** * Public key of the refreshed coin. @@ -1321,7 +1321,7 @@ struct TALER_PaybackRefreshConfirmationPS struct TALER_CoinSpendPublicKeyP coin_pub; /** - * Public key of the old coin that will receive the payback. + * Public key of the old coin that will receive the recoup. */ struct TALER_CoinSpendPublicKeyP old_coin_pub; }; @@ -1355,7 +1355,7 @@ struct TALER_ReserveCloseConfirmationPS struct TALER_AmountNBO closing_fee; /** - * Public key of the reserve that received the payback. + * Public key of the reserve that received the recoup. */ struct TALER_ReservePublicKeyP reserve_pub; diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h index 3d9abae0e..0b3d19999 100644 --- a/src/include/taler_testing_lib.h +++ b/src/include/taler_testing_lib.h @@ -1567,7 +1567,7 @@ TALER_TESTING_cmd_refund (const char *label, /** - * Make a "payback" command. + * Make a "recoup" command. * * @param label the command label * @param expected_response_code expected HTTP status code @@ -1580,11 +1580,11 @@ TALER_TESTING_cmd_refund (const char *label, * @return the command. */ struct TALER_TESTING_Command -TALER_TESTING_cmd_payback (const char *label, - unsigned int expected_response_code, - const char *coin_reference, - const char *amount, - const char *melt_reference); +TALER_TESTING_cmd_recoup (const char *label, + unsigned int expected_response_code, + const char *coin_reference, + const char *amount, + const char *melt_reference); /** -- cgit v1.2.3