gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 01/06: Trigger /refund currency missmatch


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 01/06: Trigger /refund currency missmatch the right way.
Date: Thu, 17 May 2018 21:29:43 +0200

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

marcello pushed a commit to branch master
in repository exchange.

commit 2fff7d8f3abfdd29b865c94285f3814d8b5f7ecc
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu May 17 14:30:02 2018 +0200

    Trigger /refund currency missmatch the right way.
---
 src/exchange-lib/exchange_api_refund.c       |  4 ++++
 src/exchange-lib/test_exchange_api_twisted.c | 17 +++++------------
 src/exchange-lib/testing_api_cmd_refund.c    |  8 ++++++--
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/src/exchange-lib/exchange_api_refund.c 
b/src/exchange-lib/exchange_api_refund.c
index ef1d66b..1ddf642 100644
--- a/src/exchange-lib/exchange_api_refund.c
+++ b/src/exchange-lib/exchange_api_refund.c
@@ -180,6 +180,10 @@ handle_refund_finished (void *cls,
     /* Kind of normal: the money was already sent to the merchant
        (it was too late for the refund). */
     break;
+  case MHD_HTTP_PRECONDITION_FAILED:
+    /* Client request was inconsistent; might be a currency missmatch
+       problem.  */
+    break;
   case MHD_HTTP_INTERNAL_SERVER_ERROR:
     /* Server had an internal issue; we should retry, but this API
        leaves this to the application */
diff --git a/src/exchange-lib/test_exchange_api_twisted.c 
b/src/exchange-lib/test_exchange_api_twisted.c
index 6b044a8..63358e7 100644
--- a/src/exchange-lib/test_exchange_api_twisted.c
+++ b/src/exchange-lib/test_exchange_api_twisted.c
@@ -201,7 +201,7 @@ run (void *cls,
        /* Next chunk, refund conflicts
        
          (contract hash missmatch [!],
-          original deposit does not exist,
+          original deposit does not exist V,
           currency missmatch) V;
           
           'refund_transaction()' has many of the relevant cases;
@@ -235,18 +235,11 @@ run (void *cls,
        "EUR:5",
        MHD_HTTP_OK),
 
-    TALER_TESTING_cmd_modify_object_ul
-      ("hack-currency",
-       CONFIG_FILE,
-       /* Will make currency missmatch */
-       "refund_amount",
-       "USD:5"),
-
     TALER_TESTING_cmd_refund
       ("refund-currency-missmatch",
-       MHD_HTTP_BAD_REQUEST,
-       "EUR:5",
-       "EUR:0.01",
+       MHD_HTTP_PRECONDITION_FAILED,
+       "USD:5",
+       "USD:0.01",
        "deposit-refund-1"),
 
     TALER_TESTING_cmd_refund
@@ -291,7 +284,7 @@ run (void *cls,
 
     TALER_TESTING_cmd_refund
       ("refund-deposit-not-found",
-       MHD_HTTP_BAD_REQUEST,
+       MHD_HTTP_NOT_FOUND,
        "EUR:5",
        "EUR:0.01",
        "deposit-refund-to-fail"),
diff --git a/src/exchange-lib/testing_api_cmd_refund.c 
b/src/exchange-lib/testing_api_cmd_refund.c
index 35cb20d..d0f48bb 100644
--- a/src/exchange-lib/testing_api_cmd_refund.c
+++ b/src/exchange-lib/testing_api_cmd_refund.c
@@ -227,8 +227,12 @@ refund_run (void *cls,
   }
 
   rs->rh = TALER_EXCHANGE_refund
-    (rs->exchange, &refund_amount, &refund_fee, &h_contract_terms,
-     &coin, rs->refund_transaction_id,
+    (rs->exchange,
+     &refund_amount,
+     &refund_fee,
+     &h_contract_terms,
+     &coin,
+     rs->refund_transaction_id,
      (const struct TALER_MerchantPrivateKeyP *) merchant_priv,
      &refund_cb, rs);
 

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



reply via email to

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