gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] branch master updated: refund fee stored a


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated: refund fee stored along deposit
Date: Wed, 07 Jun 2017 15:17:13 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new 2aab5f3  refund fee stored along deposit
2aab5f3 is described below

commit 2aab5f342e452b41cedc9817eed5f8796fe510d2
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Jun 7 15:17:17 2017 +0200

    refund fee stored along deposit
---
 doc/version.texi                           |  4 ++--
 src/backend/taler-merchant-httpd_pay.c     |  7 +++++++
 src/backenddb/plugin_merchantdb_postgres.c | 10 ++++++++--
 src/backenddb/test_merchantdb.c            |  9 +++++++++
 src/include/taler_merchantdb_plugin.h      |  2 +-
 5 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/doc/version.texi b/doc/version.texi
index fc2400a..acbfcb4 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,4 +1,4 @@
address@hidden UPDATED 7 June 2017
address@hidden UPDATED-MONTH June 2017
address@hidden UPDATED 31 May 2017
address@hidden UPDATED-MONTH May 2017
 @set EDITION 0.3.0
 @set VERSION 0.3.0
diff --git a/src/backend/taler-merchant-httpd_pay.c 
b/src/backend/taler-merchant-httpd_pay.c
index 837b17d..3ef8f9f 100644
--- a/src/backend/taler-merchant-httpd_pay.c
+++ b/src/backend/taler-merchant-httpd_pay.c
@@ -78,6 +78,11 @@ struct DepositConfirmation
   struct TALER_Amount deposit_fee;
 
   /**
+   * Fee charged by the exchange for the refund operation of this coin.
+   */
+  struct TALER_Amount refund_fee;
+
+  /**
    * Public key of the coin.
    */
   struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -496,6 +501,7 @@ deposit_cb (void *cls,
                         &dc->coin_pub,
                         &dc->amount_with_fee,
                         &dc->deposit_fee,
+                        &dc->refund_fee,
                          sign_key,
                         proof))
   {
@@ -662,6 +668,7 @@ process_pay_with_exchange (void *cls,
       return;
     }
     dc->deposit_fee = denom_details->fee_deposit;
+    dc->refund_fee = denom_details->fee_refund;
     if (0 == i)
     {
       acc_fee = denom_details->fee_deposit;
diff --git a/src/backenddb/plugin_merchantdb_postgres.c 
b/src/backenddb/plugin_merchantdb_postgres.c
index f262000..e0711a7 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -212,10 +212,13 @@ postgres_initialize (void *cls)
                             ",deposit_fee_val"
                             ",deposit_fee_frac"
                             ",deposit_fee_curr"
+                            ",refund_fee_val"
+                            ",refund_fee_frac"
+                            ",refund_fee_curr"
                             ",signkey_pub"
                             ",exchange_proof) VALUES "
-                            "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11)",
-                            11),
+                            "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, 
$12, $13, $14)",
+                            14),
     GNUNET_PQ_make_prepare ("insert_transfer",
                             "INSERT INTO merchant_transfers"
                             "(h_contract_terms"
@@ -633,6 +636,7 @@ postgres_store_transaction (void *cls,
  * @param coin_pub public key of the coin
  * @param amount_with_fee amount the exchange will deposit for this coin
  * @param deposit_fee fee the exchange will charge for this coin
+ * @param refund_fee fee the exchange will charge for refunding this coin
  * @param signkey_pub public key used by the exchange for @a exchange_proof
  * @param exchange_proof proof from exchange that coin was accepted
  * @return #GNUNET_OK on success, #GNUNET_SYSERR upon error
@@ -644,6 +648,7 @@ postgres_store_deposit (void *cls,
                         const struct TALER_CoinSpendPublicKeyP *coin_pub,
                         const struct TALER_Amount *amount_with_fee,
                         const struct TALER_Amount *deposit_fee,
+                        const struct TALER_Amount *refund_fee,
                         const struct TALER_ExchangePublicKeyP *signkey_pub,
                         const json_t *exchange_proof)
 {
@@ -656,6 +661,7 @@ postgres_store_deposit (void *cls,
     GNUNET_PQ_query_param_auto_from_type (coin_pub),
     TALER_PQ_query_param_amount (amount_with_fee),
     TALER_PQ_query_param_amount (deposit_fee),
+    TALER_PQ_query_param_amount (refund_fee),
     GNUNET_PQ_query_param_auto_from_type (signkey_pub),
     TALER_PQ_query_param_json (exchange_proof),
     GNUNET_PQ_query_param_end
diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c
index c512651..3bec78d 100644
--- a/src/backenddb/test_merchantdb.c
+++ b/src/backenddb/test_merchantdb.c
@@ -112,6 +112,11 @@ static struct TALER_Amount amount_with_fee;
 static struct TALER_Amount deposit_fee;
 
 /**
+ * Refund fee for the coin.
+ */
+static struct TALER_Amount refund_fee;
+
+/**
  * Public key of the coin.  Set to some random value.
  */
 static struct TALER_CoinSpendPublicKeyP coin_pub;
@@ -348,6 +353,9 @@ run (void *cls)
   GNUNET_assert (GNUNET_OK ==
                  TALER_string_to_amount (CURRENCY ":0.000010",
                                          &deposit_fee));
+  GNUNET_assert (GNUNET_OK ==
+                 TALER_string_to_amount (CURRENCY ":0.000010",
+                                         &refund_fee));
   RND_BLK (&coin_pub);
   deposit_proof = json_object ();
   GNUNET_assert (0 ==
@@ -447,6 +455,7 @@ run (void *cls)
                                  &coin_pub,
                                  &amount_with_fee,
                                  &deposit_fee,
+                                 &refund_fee,
                                  &signkey_pub,
                                  deposit_proof));
   FAILIF (GNUNET_OK !=
diff --git a/src/include/taler_merchantdb_plugin.h 
b/src/include/taler_merchantdb_plugin.h
index 9e7ec88..a006ae0 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -347,7 +347,7 @@ struct TALER_MERCHANTDB_Plugin
                     const struct TALER_CoinSpendPublicKeyP *coin_pub,
                     const struct TALER_Amount *amount_with_fee,
                     const struct TALER_Amount *deposit_fee,
-                    // const struct TALER_Amount *refund_fee, // FIXME: modify 
logic!
+                    const struct TALER_Amount *refund_fee,
                     const struct TALER_ExchangePublicKeyP *signkey_pub,
                     const json_t *exchange_proof);
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]