gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] 244/277: use and handle all /pay status codes


From: gnunet
Subject: [taler-merchant] 244/277: use and handle all /pay status codes
Date: Sun, 05 Jul 2020 20:52:37 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

commit cecafaab58860d7b49ce72d139270f8517ea6025
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Jun 23 19:51:47 2020 +0200

    use and handle all /pay status codes
---
 src/backend/taler-merchant-httpd_post-orders-ID-pay.c | 2 +-
 src/lib/merchant_api_post_order_pay.c                 | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index 15f57c4..37d98b8 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -848,7 +848,7 @@ process_pay_with_exchange (void *cls,
       GNUNET_break_op (0);
       resume_pay_with_response (
         pc,
-        MHD_HTTP_UNAUTHORIZED,
+        MHD_HTTP_FORBIDDEN,
         TALER_MHD_make_json_pack (
           "{s:s, s:I, s:i}",
           "hint", "deposit signature invalid",
diff --git a/src/lib/merchant_api_post_order_pay.c 
b/src/lib/merchant_api_post_order_pay.c
index 477c3a3..27f380f 100644
--- a/src/lib/merchant_api_post_order_pay.c
+++ b/src/lib/merchant_api_post_order_pay.c
@@ -245,7 +245,6 @@ handle_pay_finished (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "/pay completed with response code %u\n",
               (unsigned int) response_code);
-  // FIXME: check response codes here match documentation match what service 
generates!
   switch (response_code)
   {
   case 0:
@@ -306,6 +305,11 @@ handle_pay_finished (void *cls,
      * or the merchant is buggy (or API version conflict);
      * just pass JSON reply to the application */
     break;
+  case MHD_HTTP_PAYMENT_REQUIRED:
+    /* was originally paid, but then refunded */
+    hr.ec = TALER_JSON_get_error_code (json);
+    hr.hint = TALER_JSON_get_error_hint (json);
+    break;
   case MHD_HTTP_FORBIDDEN:
     hr.ec = TALER_JSON_get_error_code (json);
     hr.hint = TALER_JSON_get_error_hint (json);

-- 
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]