diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-05-02 22:03:52 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-05-02 22:03:52 +0200 |
commit | 9e90a4432b414382344ea525a34af27e661523f4 (patch) | |
tree | 2ce2447f48ef9904c25033730d2d91cf2c2d8e72 /src/lib | |
parent | 3493795065b8fde49a5a4c06e5302b2afd03685a (diff) |
fix/complete inventory management logic
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/merchant_api_post_order_abort.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/merchant_api_post_order_abort.c b/src/lib/merchant_api_post_order_abort.c index 9b45e380..6ee20f93 100644 --- a/src/lib/merchant_api_post_order_abort.c +++ b/src/lib/merchant_api_post_order_abort.c @@ -122,8 +122,13 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *ph, GNUNET_break_op (0); return GNUNET_SYSERR; } + if (! json_is_array (refunds)) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (spec); + return GNUNET_SYSERR; + } num_refunds = json_array_size (refunds); - // FIXME: test for array first! { struct TALER_MERCHANT_AbortedCoin res[GNUNET_NZL (num_refunds)]; @@ -380,11 +385,18 @@ handle_abort_finished (void *cls, merchant is buggy (or API version conflict); just pass JSON reply to the application */ break; - case MHD_HTTP_CONFLICT: + case MHD_HTTP_FORBIDDEN: hr.ec = TALER_JSON_get_error_code (json); hr.hint = TALER_JSON_get_error_hint (json); break; - case MHD_HTTP_FORBIDDEN: + case MHD_HTTP_NOT_FOUND: + hr.ec = TALER_JSON_get_error_code (json); + hr.hint = TALER_JSON_get_error_hint (json); + /* Nothing really to verify, this should never + happen, we should pass the JSON reply to the + application */ + break; + case MHD_HTTP_REQUEST_TIMEOUT: hr.ec = TALER_JSON_get_error_code (json); hr.hint = TALER_JSON_get_error_hint (json); /* Nothing really to verify, merchant says one of @@ -392,12 +404,10 @@ handle_abort_finished (void *cls, this should never happen, we should pass the JSON reply to the application */ break; - case MHD_HTTP_NOT_FOUND: + case MHD_HTTP_PRECONDITION_FAILED: + /* Our *payment* already succeeded fully. */ hr.ec = TALER_JSON_get_error_code (json); hr.hint = TALER_JSON_get_error_hint (json); - /* Nothing really to verify, this should never - happen, we should pass the JSON reply to the - application */ break; case MHD_HTTP_FAILED_DEPENDENCY: TALER_MERCHANT_parse_error_details_ (json, |