introduce refund fee
This commit is contained in:
parent
1d8da4bf84
commit
f693e25793
@ -28,6 +28,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.01
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_5]
|
||||
@ -39,6 +40,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.01
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_10]
|
||||
@ -50,6 +52,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.01
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_1000]
|
||||
@ -61,4 +64,5 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.01
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 2048
|
||||
|
@ -67,6 +67,8 @@ The following options must be in sections starting with "[coin_]" and are used b
|
||||
What fee is charged for depositing?
|
||||
.IP FEE_REFRESH
|
||||
What fee is charged for refreshing?
|
||||
.IP FEE_REFUND
|
||||
What fee is charged for refunds? When a coin is refunded, the deposit fee is returned. Instead, the refund fee is charged to the customer.
|
||||
.IP RSA_KEYSIZE
|
||||
What is the RSA keysize modulos (in bits)?
|
||||
|
||||
|
@ -520,7 +520,8 @@ main (int argc,
|
||||
NULL, NULL, NULL,
|
||||
"taler-bank-manage",
|
||||
"taler-bank-manage",
|
||||
"serve-http", "--port", "8081",
|
||||
"serve-http",
|
||||
"--port", "8081",
|
||||
NULL);
|
||||
if (NULL == bankd)
|
||||
{
|
||||
|
@ -253,6 +253,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
|
||||
struct TALER_Amount fee_withdraw;
|
||||
struct TALER_Amount fee_deposit;
|
||||
struct TALER_Amount fee_refresh;
|
||||
struct TALER_Amount fee_refund;
|
||||
struct TALER_DenominationKeyValidityPS denom_key_issue;
|
||||
struct GNUNET_CRYPTO_RsaPublicKey *pk;
|
||||
struct GNUNET_CRYPTO_EddsaSignature sig;
|
||||
@ -276,6 +277,8 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
|
||||
&fee_deposit),
|
||||
TALER_JSON_spec_amount ("fee_refresh",
|
||||
&fee_refresh),
|
||||
TALER_JSON_spec_amount ("fee_refund",
|
||||
&fee_refund),
|
||||
GNUNET_JSON_spec_rsa_public_key ("denom_pub",
|
||||
&pk),
|
||||
GNUNET_JSON_spec_end()
|
||||
@ -309,6 +312,8 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
|
||||
&fee_deposit);
|
||||
TALER_amount_hton (&denom_key_issue.fee_refresh,
|
||||
&fee_refresh);
|
||||
TALER_amount_hton (&denom_key_issue.fee_refund,
|
||||
&fee_refund);
|
||||
EXITIF (GNUNET_SYSERR ==
|
||||
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY,
|
||||
&denom_key_issue.purpose,
|
||||
@ -327,6 +332,7 @@ parse_json_denomkey (struct TALER_EXCHANGE_DenomPublicKey *denom_key,
|
||||
denom_key->fee_withdraw = fee_withdraw;
|
||||
denom_key->fee_deposit = fee_deposit;
|
||||
denom_key->fee_refresh = fee_refresh;
|
||||
denom_key->fee_refund = fee_refund;
|
||||
return GNUNET_OK;
|
||||
|
||||
EXITIF_exit:
|
||||
@ -435,6 +441,8 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
|
||||
&dk->fee_deposit);
|
||||
TALER_amount_hton (&kv.fee_refresh,
|
||||
&dk->fee_refresh);
|
||||
TALER_amount_hton (&kv.fee_refund,
|
||||
&dk->fee_refund);
|
||||
kv.denom_hash = dk->h_key;
|
||||
if (GNUNET_OK !=
|
||||
GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_AUDITOR_EXCHANGE_KEYS,
|
||||
|
@ -48,6 +48,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.00
|
||||
fee_deposit = EUR:0.00
|
||||
fee_refresh = EUR:0.01
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_ct_10]
|
||||
@ -59,6 +60,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.03
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_1]
|
||||
@ -70,6 +72,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.03
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_5]
|
||||
@ -81,6 +84,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.03
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_10]
|
||||
@ -92,4 +96,5 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.03
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
@ -22,4 +22,5 @@
|
||||
# fee_withdraw = EUR:0.00
|
||||
# fee_deposit = EUR:0.00
|
||||
# fee_refresh = EUR:0.01
|
||||
# fee_refund = EUR:0.01
|
||||
# rsa_keysize = 1024
|
||||
|
@ -103,6 +103,12 @@ print_dk (const struct TALER_DenominationKeyValidityPS *dk)
|
||||
"Refresh fee: %s\n",
|
||||
s = TALER_amount_to_string (&a));
|
||||
GNUNET_free (s);
|
||||
TALER_amount_ntoh (&a,
|
||||
&dk->fee_refund);
|
||||
fprintf (stdout,
|
||||
"Refund fee: %s\n",
|
||||
s = TALER_amount_to_string (&a));
|
||||
GNUNET_free (s);
|
||||
|
||||
fprintf (stdout,
|
||||
"Validity start time: %s\n",
|
||||
|
@ -78,6 +78,11 @@ struct CoinTypeNBOP
|
||||
*/
|
||||
struct TALER_AmountNBO fee_refresh;
|
||||
|
||||
/**
|
||||
* What is the fee charged for refunds?
|
||||
*/
|
||||
struct TALER_AmountNBO fee_refund;
|
||||
|
||||
/**
|
||||
* Key size in NBO.
|
||||
*/
|
||||
@ -140,6 +145,11 @@ struct CoinTypeParams
|
||||
*/
|
||||
struct TALER_Amount fee_refresh;
|
||||
|
||||
/**
|
||||
* What is the fee charged for refunds?
|
||||
*/
|
||||
struct TALER_Amount fee_refund;
|
||||
|
||||
/**
|
||||
* Time at which this coin is supposed to become valid.
|
||||
*/
|
||||
@ -261,6 +271,8 @@ hash_coin_type (const struct CoinTypeParams *p,
|
||||
&p->fee_deposit);
|
||||
TALER_amount_hton (&p_nbo.fee_refresh,
|
||||
&p->fee_refresh);
|
||||
TALER_amount_hton (&p_nbo.fee_refund,
|
||||
&p->fee_refund);
|
||||
p_nbo.rsa_keysize = htonl (p->rsa_keysize);
|
||||
GNUNET_CRYPTO_hash (&p_nbo,
|
||||
sizeof (struct CoinTypeNBOP),
|
||||
@ -707,6 +719,17 @@ get_cointype_params (const char *ct,
|
||||
"fee_refresh");
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
if (GNUNET_OK !=
|
||||
TALER_config_get_denom (kcfg,
|
||||
ct,
|
||||
"fee_refund",
|
||||
¶ms->fee_refund))
|
||||
{
|
||||
GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
|
||||
ct,
|
||||
"fee_refund");
|
||||
return GNUNET_SYSERR;
|
||||
}
|
||||
|
||||
dir = get_cointype_dir (params);
|
||||
get_anchor (dir,
|
||||
@ -756,6 +779,8 @@ create_denomkey_issue (const struct CoinTypeParams *params,
|
||||
¶ms->fee_deposit);
|
||||
TALER_amount_hton (&dki->issue.properties.fee_refresh,
|
||||
¶ms->fee_refresh);
|
||||
TALER_amount_hton (&dki->issue.properties.fee_refund,
|
||||
¶ms->fee_refund);
|
||||
dki->issue.properties.purpose.purpose
|
||||
= htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY);
|
||||
dki->issue.properties.purpose.size
|
||||
|
@ -133,6 +133,7 @@ denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk,
|
||||
struct TALER_Amount fee_withdraw;
|
||||
struct TALER_Amount fee_deposit;
|
||||
struct TALER_Amount fee_refresh;
|
||||
struct TALER_Amount fee_refund;
|
||||
|
||||
TALER_amount_ntoh (&value,
|
||||
&dki->properties.value);
|
||||
@ -142,8 +143,10 @@ denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk,
|
||||
&dki->properties.fee_deposit);
|
||||
TALER_amount_ntoh (&fee_refresh,
|
||||
&dki->properties.fee_refresh);
|
||||
TALER_amount_ntoh (&fee_refund,
|
||||
&dki->properties.fee_refund);
|
||||
return
|
||||
json_pack ("{s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o}",
|
||||
json_pack ("{s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o}",
|
||||
"master_sig",
|
||||
GNUNET_JSON_from_data (&dki->signature,
|
||||
sizeof (struct GNUNET_CRYPTO_EddsaSignature)),
|
||||
@ -164,7 +167,9 @@ denom_key_issue_to_json (const struct TALER_DenominationPublicKey *pk,
|
||||
"fee_deposit",
|
||||
TALER_JSON_from_amount (&fee_deposit),
|
||||
"fee_refresh",
|
||||
TALER_JSON_from_amount (&fee_refresh));
|
||||
TALER_JSON_from_amount (&fee_refresh),
|
||||
"fee_refund",
|
||||
TALER_JSON_from_amount (&fee_refund));
|
||||
}
|
||||
|
||||
|
||||
|
@ -359,6 +359,9 @@ fake_issue (struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue)
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_string_to_amount_nbo ("EUR:0.1",
|
||||
&issue->properties.fee_refresh));
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_string_to_amount_nbo ("EUR:0.1",
|
||||
&issue->properties.fee_refund));
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,6 +50,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.00
|
||||
fee_deposit = EUR:0.00
|
||||
fee_refresh = EUR:0.01
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_ct_10]
|
||||
@ -61,6 +62,7 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.03
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
||||
[coin_eur_1]
|
||||
@ -72,4 +74,5 @@ duration_legal = 3 years
|
||||
fee_withdraw = EUR:0.01
|
||||
fee_deposit = EUR:0.01
|
||||
fee_refresh = EUR:0.03
|
||||
fee_refund = EUR:0.01
|
||||
rsa_keysize = 1024
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of TALER
|
||||
Copyright (C) 2014, 2015 GNUnet e.V.
|
||||
Copyright (C) 2014, 2015, 2016 Inria and GNUnet e.V.
|
||||
|
||||
TALER is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
@ -17,6 +17,7 @@
|
||||
* @file exchangedb/perf_taler_exchangedb.c
|
||||
* @brief Exchange database performance analysis
|
||||
* @author Nicolas Fournier
|
||||
* @author Christian Grothoff
|
||||
*/
|
||||
#include "platform.h"
|
||||
#include "perf_taler_exchangedb_interpreter.h"
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
This file is part of TALER
|
||||
Copyright (C) 2014, 2015 GNUnet e.V.
|
||||
Copyright (C) 2014, 2015, 2016 Inria & GNUnet e.V.
|
||||
|
||||
TALER is free software; you can redistribute it and/or modify it under the
|
||||
terms of the GNU General Public License as published by the Free Software
|
||||
@ -17,6 +17,7 @@
|
||||
* @file exchangedb/perf_taler_exchangedb_init.c
|
||||
* @brief Interpreter library for exchange database performance analysis
|
||||
* @author Nicolas Fournier
|
||||
* @author Christian Grothoff
|
||||
*/
|
||||
#include "platform.h"
|
||||
#include "perf_taler_exchangedb_init.h"
|
||||
@ -75,6 +76,7 @@ PERF_TALER_EXCHANGEDB_denomination_init ()
|
||||
TALER_amount_hton (&properties.fee_withdraw, &amount);
|
||||
TALER_amount_hton (&properties.fee_deposit, &amount);
|
||||
TALER_amount_hton (&properties.fee_refresh, &amount);
|
||||
TALER_amount_hton (&properties.fee_refund, &amount);
|
||||
GNUNET_CRYPTO_rsa_public_key_hash (denom_pub.rsa_public_key,
|
||||
&properties.denom_hash);
|
||||
issue.properties = properties;
|
||||
|
@ -79,8 +79,7 @@ PERF_TALER_EXCHANGEDB_denomination_init (void);
|
||||
* @return a copy of @a deposit; NULL if error
|
||||
*/
|
||||
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *
|
||||
PERF_TALER_EXCHANGEDB_denomination_copy (
|
||||
const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
|
||||
PERF_TALER_EXCHANGEDB_denomination_copy (const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
|
||||
|
||||
|
||||
/**
|
||||
@ -88,8 +87,7 @@ PERF_TALER_EXCHANGEDB_denomination_copy (
|
||||
* @param dki pointer to the struct to free
|
||||
*/
|
||||
int
|
||||
PERF_TALER_EXCHANGEDB_denomination_free (
|
||||
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
|
||||
PERF_TALER_EXCHANGEDB_denomination_free (struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki);
|
||||
|
||||
|
||||
/**
|
||||
@ -122,8 +120,7 @@ PERF_TALER_EXCHANGEDB_reserve_free (struct PERF_TALER_EXCHANGEDB_Reserve *reserv
|
||||
* @param dki the denomination key used to sign the key
|
||||
*/
|
||||
struct TALER_EXCHANGEDB_Deposit *
|
||||
PERF_TALER_EXCHANGEDB_deposit_init (
|
||||
const struct PERF_TALER_EXCHANGEDB_Coin *coin);
|
||||
PERF_TALER_EXCHANGEDB_deposit_init (const struct PERF_TALER_EXCHANGEDB_Coin *coin);
|
||||
|
||||
|
||||
/**
|
||||
@ -150,8 +147,7 @@ PERF_TALER_EXCHANGEDB_deposit_free (struct TALER_EXCHANGEDB_Deposit *deposit);
|
||||
* @return a randomly generated CollectableBlindcoin
|
||||
*/
|
||||
struct PERF_TALER_EXCHANGEDB_Coin *
|
||||
PERF_TALER_EXCHANGEDB_coin_init (
|
||||
const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki,
|
||||
PERF_TALER_EXCHANGEDB_coin_init (const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki,
|
||||
const struct PERF_TALER_EXCHANGEDB_Reserve *reserve);
|
||||
|
||||
|
||||
@ -161,8 +157,7 @@ PERF_TALER_EXCHANGEDB_coin_init (
|
||||
* @return a copy of coin; NULL if error
|
||||
*/
|
||||
struct PERF_TALER_EXCHANGEDB_Coin *
|
||||
PERF_TALER_EXCHANGEDB_coin_copy (
|
||||
const struct PERF_TALER_EXCHANGEDB_Coin *coin);
|
||||
PERF_TALER_EXCHANGEDB_coin_copy (const struct PERF_TALER_EXCHANGEDB_Coin *coin);
|
||||
|
||||
|
||||
/**
|
||||
@ -170,8 +165,7 @@ PERF_TALER_EXCHANGEDB_coin_copy (
|
||||
* @param coin pointer to the structure to free
|
||||
*/
|
||||
int
|
||||
PERF_TALER_EXCHANGEDB_coin_free (
|
||||
struct PERF_TALER_EXCHANGEDB_Coin *coin);
|
||||
PERF_TALER_EXCHANGEDB_coin_free (struct PERF_TALER_EXCHANGEDB_Coin *coin);
|
||||
|
||||
|
||||
/**
|
||||
@ -193,8 +187,7 @@ PERF_TALER_EXCHANGEDB_refresh_session_copy (struct TALER_EXCHANGEDB_RefreshSessi
|
||||
* Frees memory of a refresh_session
|
||||
*/
|
||||
int
|
||||
PERF_TALER_EXCHANGEDB_refresh_session_free (
|
||||
struct TALER_EXCHANGEDB_RefreshSession *refresh_session);
|
||||
PERF_TALER_EXCHANGEDB_refresh_session_free (struct TALER_EXCHANGEDB_RefreshSession *refresh_session);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -272,6 +272,9 @@ postgres_create_tables (void *cls,
|
||||
",fee_refresh_val INT8 NOT NULL"
|
||||
",fee_refresh_frac INT4 NOT NULL"
|
||||
",fee_refresh_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||
",fee_refund_val INT8 NOT NULL"
|
||||
",fee_refund_frac INT4 NOT NULL"
|
||||
",fee_refund_curr VARCHAR("TALER_CURRENCY_LEN_STR") NOT NULL"
|
||||
")");
|
||||
/* reserves table is for summarization of a reserve. It is updated when new
|
||||
funds are added and existing funds are withdrawn. The 'expiration_date'
|
||||
@ -544,10 +547,14 @@ postgres_prepare (PGconn *db_conn)
|
||||
",fee_refresh_val"
|
||||
",fee_refresh_frac"
|
||||
",fee_refresh_curr" /* must match coin_curr */
|
||||
",fee_refund_val"
|
||||
",fee_refund_frac"
|
||||
",fee_refund_curr" /* must match coin_curr */
|
||||
") VALUES "
|
||||
"($1, $2, $3, $4, $5, $6, $7, $8, $9, $10,"
|
||||
" $11, $12, $13, $14, $15, $16, $17, $18, $19);",
|
||||
19, NULL);
|
||||
" $11, $12, $13, $14, $15, $16, $17, $18,"
|
||||
" $19, $20, $21, $22);",
|
||||
22, NULL);
|
||||
|
||||
/* Used in #postgres_get_denomination_info() */
|
||||
PREPARE ("denomination_get",
|
||||
@ -570,6 +577,9 @@ postgres_prepare (PGconn *db_conn)
|
||||
",fee_refresh_val"
|
||||
",fee_refresh_frac"
|
||||
",fee_refresh_curr" /* must match coin_curr */
|
||||
",fee_refund_val"
|
||||
",fee_refund_frac"
|
||||
",fee_refund_curr" /* must match coin_curr */
|
||||
" FROM denominations"
|
||||
" WHERE pub=$1;",
|
||||
1, NULL);
|
||||
@ -1378,6 +1388,7 @@ postgres_insert_denomination_info (void *cls,
|
||||
TALER_PQ_query_param_amount_nbo (&issue->properties.fee_withdraw),
|
||||
TALER_PQ_query_param_amount_nbo (&issue->properties.fee_deposit),
|
||||
TALER_PQ_query_param_amount_nbo (&issue->properties.fee_refresh),
|
||||
TALER_PQ_query_param_amount_nbo (&issue->properties.fee_refund),
|
||||
GNUNET_PQ_query_param_end
|
||||
};
|
||||
/* check fees match coin currency */
|
||||
@ -1390,6 +1401,9 @@ postgres_insert_denomination_info (void *cls,
|
||||
GNUNET_assert (GNUNET_YES ==
|
||||
TALER_amount_cmp_currency_nbo (&issue->properties.value,
|
||||
&issue->properties.fee_refresh));
|
||||
GNUNET_assert (GNUNET_YES ==
|
||||
TALER_amount_cmp_currency_nbo (&issue->properties.value,
|
||||
&issue->properties.fee_refund));
|
||||
|
||||
result = GNUNET_PQ_exec_prepared (session->conn,
|
||||
"denomination_insert",
|
||||
@ -1476,6 +1490,8 @@ postgres_get_denomination_info (void *cls,
|
||||
&issue->properties.fee_deposit),
|
||||
TALER_PQ_result_spec_amount_nbo ("fee_refresh",
|
||||
&issue->properties.fee_refresh),
|
||||
TALER_PQ_result_spec_amount_nbo ("fee_refund",
|
||||
&issue->properties.fee_refund),
|
||||
GNUNET_PQ_result_spec_end
|
||||
};
|
||||
|
||||
|
@ -16,7 +16,8 @@
|
||||
/**
|
||||
* @file exchangedb/test_exchangedb.c
|
||||
* @brief test cases for DB interaction functions
|
||||
* @author Sree Harsha Totakura <sreeharsha@totakura.in>
|
||||
* @author Sree Harsha Totakura
|
||||
* @author Christian Grothoff
|
||||
*/
|
||||
#include "platform.h"
|
||||
#include "taler_exchangedb_lib.h"
|
||||
@ -114,7 +115,8 @@ create_denom_key_pair (unsigned int size,
|
||||
const struct TALER_Amount *value,
|
||||
const struct TALER_Amount *fee_withdraw,
|
||||
const struct TALER_Amount *fee_deposit,
|
||||
const struct TALER_Amount *fee_refresh)
|
||||
const struct TALER_Amount *fee_refresh,
|
||||
const struct TALER_Amount *fee_refund)
|
||||
{
|
||||
struct DenomKeyPair *dkp;
|
||||
struct TALER_EXCHANGEDB_DenominationKeyIssueInformation dki;
|
||||
@ -147,6 +149,7 @@ create_denom_key_pair (unsigned int size,
|
||||
TALER_amount_hton (&dki.issue.properties.fee_withdraw, fee_withdraw);
|
||||
TALER_amount_hton (&dki.issue.properties.fee_deposit, fee_deposit);
|
||||
TALER_amount_hton (&dki.issue.properties.fee_refresh, fee_refresh);
|
||||
TALER_amount_hton (&dki.issue.properties.fee_refund, fee_refund);
|
||||
GNUNET_CRYPTO_rsa_public_key_hash (dkp->pub.rsa_public_key,
|
||||
&dki.issue.properties.denom_hash);
|
||||
if (GNUNET_OK !=
|
||||
@ -166,11 +169,11 @@ static struct TALER_Amount value;
|
||||
static struct TALER_Amount fee_withdraw;
|
||||
static struct TALER_Amount fee_deposit;
|
||||
static struct TALER_Amount fee_refresh;
|
||||
static struct TALER_Amount fee_refund;
|
||||
static struct TALER_Amount amount_with_fee;
|
||||
|
||||
static void
|
||||
free_refresh_commit_coins_array(struct TALER_EXCHANGEDB_RefreshCommitCoin
|
||||
*commit_coins,
|
||||
free_refresh_commit_coins_array(struct TALER_EXCHANGEDB_RefreshCommitCoin *commit_coins,
|
||||
unsigned int size)
|
||||
{
|
||||
unsigned int cnt;
|
||||
@ -331,7 +334,8 @@ test_melting (struct TALER_EXCHANGEDB_Session *session)
|
||||
&value,
|
||||
&fee_withdraw,
|
||||
&fee_deposit,
|
||||
&fee_refresh);
|
||||
&fee_refresh,
|
||||
&fee_refund);
|
||||
/* create MELT_OLD_COINS number of refresh melts */
|
||||
melts = GNUNET_new_array (MELT_OLD_COINS, struct TALER_EXCHANGEDB_RefreshMelt);
|
||||
for (cnt=0; cnt < MELT_OLD_COINS; cnt++)
|
||||
@ -394,7 +398,8 @@ test_melting (struct TALER_EXCHANGEDB_Session *session)
|
||||
&value,
|
||||
&fee_withdraw,
|
||||
&fee_deposit,
|
||||
&fee_refresh);
|
||||
&fee_refresh,
|
||||
&fee_refund);
|
||||
new_denom_pubs[cnt]=new_dkp[cnt]->pub;
|
||||
}
|
||||
FAILIF (GNUNET_OK != plugin->insert_refresh_order (plugin->cls,
|
||||
@ -683,6 +688,9 @@ run (void *cls)
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_string_to_amount (CURRENCY ":0.000010",
|
||||
&fee_refresh));
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_string_to_amount (CURRENCY ":0.000010",
|
||||
&fee_refund));
|
||||
GNUNET_assert (GNUNET_OK ==
|
||||
TALER_string_to_amount (CURRENCY ":1.000010",
|
||||
&amount_with_fee));
|
||||
@ -723,7 +731,8 @@ run (void *cls)
|
||||
&value,
|
||||
&fee_withdraw,
|
||||
&fee_deposit,
|
||||
&fee_refresh);
|
||||
&fee_refresh,
|
||||
&fee_refund);
|
||||
RND_BLK(&cbc.h_coin_envelope);
|
||||
RND_BLK(&cbc.reserve_sig);
|
||||
cbc.denom_pub = dkp->pub;
|
||||
|
@ -125,6 +125,11 @@ struct TALER_EXCHANGE_DenomPublicKey
|
||||
* The applicable fee to melt/refresh a coin of this denomination
|
||||
*/
|
||||
struct TALER_Amount fee_refresh;
|
||||
|
||||
/**
|
||||
* The applicable fee to refund a coin of this denomination
|
||||
*/
|
||||
struct TALER_Amount fee_refund;
|
||||
};
|
||||
|
||||
|
||||
|
@ -639,6 +639,13 @@ struct TALER_DenominationKeyValidityPS
|
||||
*/
|
||||
struct TALER_AmountNBO fee_refresh;
|
||||
|
||||
/**
|
||||
* The fee the exchange charges when a coin of this type is refunded.
|
||||
* (can be zero). Note that refund fees are charged to the customer;
|
||||
* if a refund is given, the deposit fee is also refunded.
|
||||
*/
|
||||
struct TALER_AmountNBO fee_refund;
|
||||
|
||||
/**
|
||||
* Hash code of the denomination public key. (Used to avoid having
|
||||
* the variable-size RSA key in this struct.)
|
||||
@ -735,6 +742,12 @@ struct TALER_ExchangeKeyValidityPS
|
||||
*/
|
||||
struct TALER_AmountNBO fee_refresh;
|
||||
|
||||
/**
|
||||
* The fee the exchange charges when a coin of this type is refreshed.
|
||||
* (can be zero).
|
||||
*/
|
||||
struct TALER_AmountNBO fee_refund;
|
||||
|
||||
/**
|
||||
* Hash code of the denomination public key. (Used to avoid having
|
||||
* the variable-size RSA key in this struct.)
|
||||
|
Loading…
Reference in New Issue
Block a user