summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-08-22 19:22:04 +0200
committerChristian Grothoff <christian@grothoff.org>2020-08-22 19:22:04 +0200
commit0d05df558c80b88a75397bfeea0a4249103952f2 (patch)
tree19173db0fd4b106ae3c257406970d075f1a535cc /src
parentca0fc7c0746cd355109bccf432b9ff78f34393e8 (diff)
downloadmerchant-0d05df558c80b88a75397bfeea0a4249103952f2.tar.gz
merchant-0d05df558c80b88a75397bfeea0a4249103952f2.tar.bz2
merchant-0d05df558c80b88a75397bfeea0a4249103952f2.zip
add h_contract to refund response
Diffstat (limited to 'src')
-rw-r--r--src/include/taler_merchant_service.h7
-rw-r--r--src/lib/merchant_api_post_order_refund.c10
-rw-r--r--src/testing/testing_api_cmd_refund_order.c6
3 files changed, 19 insertions, 4 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 16a01b99..f59cfec0 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -229,7 +229,7 @@ struct TALER_MERCHANT_RefundUriData
*
* @param refund_uri the URI to parse.
* @param[out] parse_data data extracted from the URI. Must be free'd.
- * @return GNUNET_SYSERR if @e refund_uri is malformed, GNUNET_OK otherwise.
+ * @return #GNUNET_SYSERR if @e refund_uri is malformed, #GNUNET_OK otherwise.
*/
int
TALER_MERCHANT_parse_refund_uri (
@@ -2353,12 +2353,15 @@ struct TALER_MERCHANT_OrderRefundHandle;
* @param http_status HTTP status code for this request
* @param ec taler-specific error code
* @param taler_refund_uri the refund uri offered to the wallet
+ * @param h_contract hash of the contract a Browser may need to authorize
+ * obtaining the HTTP response.
*/
typedef void
(*TALER_MERCHANT_RefundCallback) (
void *cls,
const struct TALER_MERCHANT_HttpResponse *hr,
- const char *taler_refund_uri);
+ const char *taler_refund_uri,
+ const struct GNUNET_HashCode *h_contract);
/**
diff --git a/src/lib/merchant_api_post_order_refund.c b/src/lib/merchant_api_post_order_refund.c
index 834aea5d..08101999 100644
--- a/src/lib/merchant_api_post_order_refund.c
+++ b/src/lib/merchant_api_post_order_refund.c
@@ -95,14 +95,18 @@ handle_refund_finished (void *cls,
hr.ec = TALER_EC_INVALID_RESPONSE;
orh->cb (orh->cb_cls,
&hr,
+ NULL,
NULL);
break;
case MHD_HTTP_OK:
{
const char *taler_refund_uri;
+ struct GNUNET_HashCode h_contract;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("taler_refund_uri",
&taler_refund_uri),
+ GNUNET_JSON_spec_fixed_auto ("h_contract",
+ &h_contract),
GNUNET_JSON_spec_end ()
};
@@ -116,12 +120,14 @@ handle_refund_finished (void *cls,
hr.ec = TALER_EC_INVALID_RESPONSE;
orh->cb (orh->cb_cls,
&hr,
+ NULL,
NULL);
break;
}
orh->cb (orh->cb_cls,
&hr,
- taler_refund_uri);
+ taler_refund_uri,
+ &h_contract);
GNUNET_JSON_parse_free (spec);
}
break;
@@ -131,6 +137,7 @@ handle_refund_finished (void *cls,
hr.hint = TALER_JSON_get_error_hint (json);
orh->cb (orh->cb_cls,
&hr,
+ NULL,
NULL);
break;
default:
@@ -140,6 +147,7 @@ handle_refund_finished (void *cls,
&hr);
orh->cb (orh->cb_cls,
&hr,
+ NULL,
NULL);
break;
}
diff --git a/src/testing/testing_api_cmd_refund_order.c b/src/testing/testing_api_cmd_refund_order.c
index bf8474dd..a22535e8 100644
--- a/src/testing/testing_api_cmd_refund_order.c
+++ b/src/testing/testing_api_cmd_refund_order.c
@@ -78,14 +78,18 @@ struct RefundState
* @param cls closure
* @param hr HTTP response
* @param taler_refund_uri the refund uri offered to the wallet
+ * @param h_contract hash of the contract a Browser may need to authorize
+ * obtaining the HTTP response.
*/
static void
refund_cb (void *cls,
const struct TALER_MERCHANT_HttpResponse *hr,
- const char *taler_refund_uri)
+ const char *taler_refund_uri,
+ const struct GNUNET_HashCode *h_contract)
{
struct RefundState *ris = cls;
+ (void) h_contract;
ris->orh = NULL;
if (ris->http_code != hr->http_status)
{