gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 267/277: get pay-again and pay-abort working again


From: gnunet
Subject: [taler-merchant] 267/277: get pay-again and pay-abort working again
Date: Sun, 05 Jul 2020 20:53:00 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

commit bd6a7e949fa07c7b4c87a694c0037e2df3903665
Author: Jonathan Buchanan <jonathan.russ.buchanan@gmail.com>
AuthorDate: Mon Jun 29 19:36:47 2020 -0400

    get pay-again and pay-abort working again
---
 src/backend/taler-merchant-httpd_post-orders-ID-abort.c |  3 +--
 src/lib/merchant_api_post_order_abort.c                 |  4 ++--
 src/testing/test_merchant_api.c                         |  8 ++++----
 src/testing/testing_api_cmd_abort_order.c               | 12 ++++++++++--
 src/testing/testing_api_cmd_pay_order.c                 |  2 ++
 5 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
index 89e1309..940db37 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-abort.c
@@ -352,7 +352,7 @@ generate_success_response (struct AbortContext *ac)
     if (0 !=
         json_array_append_new (
           refunds,
-          json_pack ("{s:I, s:O, s:o s:o s:o}",
+          json_pack ("{s:I, s:O}",
                      "exchange_http_status",
                      (json_int_t) rdi->http_status,
                      "exchange_reply",
@@ -985,7 +985,6 @@ TMH_post_orders_ID_abort (const struct TMH_RequestHandler 
*rh,
                 res ? "OK" : "FAILED");
     return res;
   }
-
   {
     enum GNUNET_GenericReturnValue ret;
 
diff --git a/src/lib/merchant_api_post_order_abort.c 
b/src/lib/merchant_api_post_order_abort.c
index f1a8fc4..f3c8224 100644
--- a/src/lib/merchant_api_post_order_abort.c
+++ b/src/lib/merchant_api_post_order_abort.c
@@ -138,7 +138,7 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle 
*oah,
       uint32_t exchange_status;
       json_t *exchange_reply;
       struct GNUNET_JSON_Specification spec_es[] = {
-        GNUNET_JSON_spec_uint32 ("exchange_status",
+        GNUNET_JSON_spec_uint32 ("exchange_http_status",
                                  &exchange_status),
         GNUNET_JSON_spec_json ("exchange_reply",
                                &exchange_reply),
@@ -179,7 +179,7 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle 
*oah,
 
       {
         struct TALER_RefundConfirmationPS rr = {
-          .purpose.purpose = htonl (TALER_SIGNATURE_MERCHANT_REFUND),
+          .purpose.purpose = htonl (TALER_SIGNATURE_EXCHANGE_CONFIRM_REFUND),
           .purpose.size = htonl (sizeof (rr)),
           .h_contract_terms = oah->h_contract_terms,
           .coin_pub = oah->coins[i].coin_pub,
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index 2f30ca7..b02d8c8 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -1180,15 +1180,15 @@ run (void *cls,
                                10,
                                10),
 #endif
+    TALER_TESTING_cmd_batch ("pay-again",
+                             pay_again),
+    TALER_TESTING_cmd_batch ("pay-abort",
+                             pay_abort),
     TALER_TESTING_cmd_batch ("refund",
                              refund),
     TALER_TESTING_cmd_batch ("tip",
                              tip),
 #if 0
-    TALER_TESTING_cmd_batch ("pay-again",
-                             pay_again),
-    TALER_TESTING_cmd_batch ("pay-abort",
-                             pay_abort),
     TALER_TESTING_cmd_history_default_start ("history-default-start",
                                              merchant_url,
                                              MHD_HTTP_OK,
diff --git a/src/testing/testing_api_cmd_abort_order.c 
b/src/testing/testing_api_cmd_abort_order.c
index d2f4e2a..c44684e 100644
--- a/src/testing/testing_api_cmd_abort_order.c
+++ b/src/testing/testing_api_cmd_abort_order.c
@@ -152,7 +152,15 @@ build_coins (struct TALER_MERCHANT_AbortCoin **ac,
                      TALER_TESTING_get_trait_url (coin_cmd,
                                                   
TALER_TESTING_UT_EXCHANGE_BASE_URL,
                                                   &icoin->exchange_url));
-      // FIXME: initialize icon->amount_with_fee!
+      {
+        const struct TALER_Amount *denom_value;
+        GNUNET_assert (GNUNET_OK
+                       == TALER_TESTING_get_trait_amount_obj (coin_cmd,
+                                                              0,
+                                                              &denom_value));
+        icoin->amount_with_fee = *denom_value;
+      }
+
     }
   }
   return GNUNET_OK;
@@ -359,7 +367,7 @@ abort_cleanup (void *cls,
 {
   struct AbortState *as = cls;
 
-  if (NULL != as->acs)
+  if (NULL != as->oah)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 "Command `%s' did not complete.\n",
diff --git a/src/testing/testing_api_cmd_pay_order.c 
b/src/testing/testing_api_cmd_pay_order.c
index ee47ae5..c576c31 100644
--- a/src/testing/testing_api_cmd_pay_order.c
+++ b/src/testing/testing_api_cmd_pay_order.c
@@ -508,6 +508,8 @@ pay_traits (void *cls,
                                          order_id),
       TALER_TESTING_make_trait_merchant_pub (0,
                                              merchant_pub),
+      TALER_TESTING_make_trait_string (0,
+                                       ps->amount_with_fee),
       TALER_TESTING_trait_end ()
     };
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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