[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.
- [taler-merchant] 242/277: also parse and return timestamp and row_id, (continued)
- [taler-merchant] 242/277: also parse and return timestamp and row_id, gnunet, 2020/07/05
- [taler-merchant] 250/277: got refunds working and tested, gnunet, 2020/07/05
- [taler-merchant] 245/277: DCE: removing legacy code and APIs, gnunet, 2020/07/05
- [taler-merchant] 246/277: implement taler-merchant-setup-reserve CLI tool, gnunet, 2020/07/05
- [taler-merchant] 252/277: minor style improvements, gnunet, 2020/07/05
- [taler-merchant] 253/277: fix FIXME, gnunet, 2020/07/05
- [taler-merchant] 254/277: logic to update 'wired' status of an order, gnunet, 2020/07/05
- [taler-merchant] 255/277: deeper checks for merchant get order, gnunet, 2020/07/05
- [taler-merchant] 248/277: deeper checks on GET /private/orders, gnunet, 2020/07/05
- [taler-merchant] 241/277: clarify with/without wire fee issue, gnunet, 2020/07/05
- [taler-merchant] 244/277: use and handle all /pay status codes,
gnunet <=
- [taler-merchant] 247/277: harder tests for GET /private/instances, GET /private/products, gnunet, 2020/07/05
- [taler-merchant] 249/277: made a testing trait for order claim nonce, gnunet, 2020/07/05
- [taler-merchant] 251/277: wallet get order handles refunds properly, gnunet, 2020/07/05
- [taler-merchant] 256/277: test for auto marking orders as wired after inserting sufficient transfers, gnunet, 2020/07/05
- [taler-merchant] 258/277: excluded doc/doxygen from gitignore, gnunet, 2020/07/05
- [taler-merchant] 257/277: updated doxygen generation, gnunet, 2020/07/05
- [taler-merchant] 260/277: fix #6236, gnunet, 2020/07/05
- [taler-merchant] 262/277: deduplicate logic, gnunet, 2020/07/05
- [taler-merchant] 264/277: filler max_upload values for all POST/PATCH handlers, gnunet, 2020/07/05
- [taler-merchant] 265/277: got tips test working again, gnunet, 2020/07/05