summaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_post_order_refund.c
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-08-20 00:49:02 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-08-20 00:49:02 -0400
commit8d172853c1c7b1ca8d9dc31194c4e73e79499a80 (patch)
treef07387eb4bfa9d0733107056242f7d85954b67cc /src/lib/merchant_api_post_order_refund.c
parentb77ef665b0f3876f2c27db2d5a9b154fa1a9ba0d (diff)
downloadmerchant-8d172853c1c7b1ca8d9dc31194c4e73e79499a80.tar.gz
merchant-8d172853c1c7b1ca8d9dc31194c4e73e79499a80.tar.bz2
merchant-8d172853c1c7b1ca8d9dc31194c4e73e79499a80.zip
parse/test refund uri
Diffstat (limited to 'src/lib/merchant_api_post_order_refund.c')
-rw-r--r--src/lib/merchant_api_post_order_refund.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/lib/merchant_api_post_order_refund.c b/src/lib/merchant_api_post_order_refund.c
index fb93864a..834aea5d 100644
--- a/src/lib/merchant_api_post_order_refund.c
+++ b/src/lib/merchant_api_post_order_refund.c
@@ -94,18 +94,44 @@ handle_refund_finished (void *cls,
case 0:
hr.ec = TALER_EC_INVALID_RESPONSE;
orh->cb (orh->cb_cls,
- &hr);
+ &hr,
+ NULL);
break;
case MHD_HTTP_OK:
- orh->cb (orh->cb_cls,
- &hr);
+ {
+ const char *taler_refund_uri;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_string ("taler_refund_uri",
+ &taler_refund_uri),
+ GNUNET_JSON_spec_end ()
+ };
+
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (json,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_break_op (0);
+ hr.http_status = 0;
+ hr.ec = TALER_EC_INVALID_RESPONSE;
+ orh->cb (orh->cb_cls,
+ &hr,
+ NULL);
+ break;
+ }
+ orh->cb (orh->cb_cls,
+ &hr,
+ taler_refund_uri);
+ GNUNET_JSON_parse_free (spec);
+ }
break;
case MHD_HTTP_CONFLICT:
case MHD_HTTP_NOT_FOUND:
hr.ec = TALER_JSON_get_error_code (json);
hr.hint = TALER_JSON_get_error_hint (json);
orh->cb (orh->cb_cls,
- &hr);
+ &hr,
+ NULL);
break;
default:
GNUNET_break_op (0); /* unexpected status code */
@@ -113,7 +139,8 @@ handle_refund_finished (void *cls,
response_code,
&hr);
orh->cb (orh->cb_cls,
- &hr);
+ &hr,
+ NULL);
break;
}
TALER_MERCHANT_post_order_refund_cancel (orh);