[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-merchant] 03/03: add h_contract to refund response
From: |
gnunet |
Subject: |
[taler-merchant] 03/03: add h_contract to refund response |
Date: |
Sat, 22 Aug 2020 19:22:10 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository merchant.
commit 0d05df558c80b88a75397bfeea0a4249103952f2
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Aug 22 19:22:04 2020 +0200
add h_contract to refund response
---
src/include/taler_merchant_service.h | 7 +++++--
src/lib/merchant_api_post_order_refund.c | 10 +++++++++-
src/testing/testing_api_cmd_refund_order.c | 6 +++++-
3 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/include/taler_merchant_service.h
b/src/include/taler_merchant_service.h
index 16a01b9..f59cfec 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 834aea5..0810199 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 bf8474d..a22535e 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)
{
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.