summaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_post_order_abort.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/merchant_api_post_order_abort.c')
-rw-r--r--src/lib/merchant_api_post_order_abort.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/lib/merchant_api_post_order_abort.c b/src/lib/merchant_api_post_order_abort.c
index a924119b..3c9665c6 100644
--- a/src/lib/merchant_api_post_order_abort.c
+++ b/src/lib/merchant_api_post_order_abort.c
@@ -111,11 +111,11 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah,
struct TALER_MERCHANT_AbortResponse *ar,
const json_t *json)
{
- json_t *refunds;
+ const json_t *refunds;
unsigned int num_refunds;
struct GNUNET_JSON_Specification spec[] = {
- GNUNET_JSON_spec_json ("refunds",
- &refunds),
+ GNUNET_JSON_spec_array_const ("refunds",
+ &refunds),
GNUNET_JSON_spec_end ()
};
@@ -127,12 +127,6 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah,
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);
{
struct TALER_MERCHANT_AbortedCoin res[GNUNET_NZL (num_refunds)];
@@ -153,7 +147,6 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah,
NULL, NULL))
{
GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
if (MHD_HTTP_OK == exchange_status)
@@ -172,7 +165,6 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah,
NULL, NULL))
{
GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
@@ -187,7 +179,6 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah,
&res[i].exchange_sig))
{
GNUNET_break_op (0);
- GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR;
}
}
@@ -199,7 +190,6 @@ check_abort_refund (struct TALER_MERCHANT_OrderAbortHandle *oah,
ar);
oah->abort_cb = NULL;
}
- GNUNET_JSON_parse_free (spec);
return GNUNET_OK;
}