[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] 42/152: return fee as well
From: |
gnunet |
Subject: |
[taler-exchange] 42/152: return fee as well |
Date: |
Sun, 05 Jul 2020 20:46:38 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit 0dfe7c23cb051003ec36707b78010132b577a180
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue May 5 22:17:16 2020 +0200
return fee as well
---
src/include/taler_error_codes.h | 19 +++++++++++++++++++
src/include/taler_exchange_service.h | 2 ++
src/lib/exchange_api_refund.c | 4 +++-
src/testing/testing_api_cmd_refund.c | 3 +++
4 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/src/include/taler_error_codes.h b/src/include/taler_error_codes.h
index f75464c3..74660303 100644
--- a/src/include/taler_error_codes.h
+++ b/src/include/taler_error_codes.h
@@ -2198,6 +2198,25 @@ enum TALER_ErrorCode
*/
TALER_EC_TIP_PICKUP_UNBLIND_FAILURE = 2812,
+ /**
+ * We failed to fetch contract terms from our merchant database. The
+ * response is provided with HTTP status code
+ * #MHD_HTTP_INTERNAL_SERVER_ERROR.
+ */
+ TALER_EC_GET_ORDERS_DB_LOOKUP_ERROR = 2900,
+
+ /**
+ * We failed to find the contract terms from our merchant database.
+ * The response is provided with HTTP status code #MHD_HTTP_NOT_FOUND.
+ */
+ TALER_EC_GET_ORDERS_ID_UNKNOWN = 2901,
+
+ /**
+ * The contract hash provided by the wallet does not match the order.
+ * The response is provided with HTTP status code #MHD_HTTP_FORBIDDEN.
+ */
+ TALER_EC_GET_ORDERS_WRONG_CONTRACT = 2902,
+
/**
* We failed to contract terms from our merchant database. The
* response is provided with HTTP status code
diff --git a/src/include/taler_exchange_service.h
b/src/include/taler_exchange_service.h
index f94b8253..82b9b83d 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -851,6 +851,7 @@ struct TALER_EXCHANGE_RefundHandle;
*
* @param cls closure
* @param hr HTTP response data
+ * @param refund_fee the refund fee the exchange charged us
* @param sign_key exchange key used to sign @a obj, or NULL
* @param signature the actual signature, or NULL on error
*/
@@ -858,6 +859,7 @@ typedef void
(*TALER_EXCHANGE_RefundCallback) (
void *cls,
const struct TALER_EXCHANGE_HttpResponse *hr,
+ const struct TALER_Amount *refund_fee,
const struct TALER_ExchangePublicKeyP *sign_key,
const struct TALER_ExchangeSignatureP *signature);
diff --git a/src/lib/exchange_api_refund.c b/src/lib/exchange_api_refund.c
index 9cb8794d..b1ea176b 100644
--- a/src/lib/exchange_api_refund.c
+++ b/src/lib/exchange_api_refund.c
@@ -92,7 +92,6 @@ verify_refund_signature_ok (struct
TALER_EXCHANGE_RefundHandle *rh,
const json_t *json,
struct TALER_ExchangePublicKeyP *exchange_pub,
struct TALER_ExchangeSignatureP *exchange_sig)
-
{
const struct TALER_EXCHANGE_Keys *key_state;
struct GNUNET_JSON_Specification spec[] = {
@@ -149,6 +148,7 @@ handle_refund_finished (void *cls,
struct TALER_ExchangeSignatureP exchange_sig;
struct TALER_ExchangePublicKeyP *ep = NULL;
struct TALER_ExchangeSignatureP *es = NULL;
+ struct TALER_Amount *rf = NULL;
const json_t *j = response;
struct TALER_EXCHANGE_HttpResponse hr = {
.reply = j,
@@ -176,6 +176,7 @@ handle_refund_finished (void *cls,
{
ep = &exchange_pub;
es = &exchange_sig;
+ rf = &rh->depconf.refund_fee;
}
break;
case MHD_HTTP_BAD_REQUEST:
@@ -234,6 +235,7 @@ handle_refund_finished (void *cls,
}
rh->cb (rh->cb_cls,
&hr,
+ rf,
ep,
es);
TALER_EXCHANGE_refund_cancel (rh);
diff --git a/src/testing/testing_api_cmd_refund.c
b/src/testing/testing_api_cmd_refund.c
index c27311fb..e662ace2 100644
--- a/src/testing/testing_api_cmd_refund.c
+++ b/src/testing/testing_api_cmd_refund.c
@@ -76,6 +76,7 @@ struct RefundState
*
* @param cls closure
* @param hr HTTP response details
+ * @param refund_fee the refund fee the exchange charged
* @param exchange_pub public key the exchange
* used for signing @a obj.
* @param exchange_sig actual signature confirming the refund
@@ -83,6 +84,7 @@ struct RefundState
static void
refund_cb (void *cls,
const struct TALER_EXCHANGE_HttpResponse *hr,
+ const struct TALER_Amount *refund_fee,
const struct TALER_ExchangePublicKeyP *exchange_pub,
const struct TALER_ExchangeSignatureP *exchange_sig)
{
@@ -90,6 +92,7 @@ refund_cb (void *cls,
struct RefundState *rs = cls;
struct TALER_TESTING_Command *refund_cmd;
+ (void) refund_fee;
refund_cmd = &rs->is->commands[rs->is->ip];
rs->rh = NULL;
if (rs->expected_response_code != hr->http_status)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-exchange] 40/152: modify TALER_EXCHANGE_deposits_get() API to avoid NULL pointers and need for deep copies, (continued)
- [taler-exchange] 40/152: modify TALER_EXCHANGE_deposits_get() API to avoid NULL pointers and need for deep copies, gnunet, 2020/07/05
- [taler-exchange] 35/152: implement #6181, gnunet, 2020/07/05
- [taler-exchange] 37/152: make tests skip until we have a wallet to regen the DB, gnunet, 2020/07/05
- [taler-exchange] 38/152: update exchange API to return struct instead of lots of individual args for TALER_EXCHANGE_transfers_get() -- simplifies merchant later, gnunet, 2020/07/05
- [taler-exchange] 39/152: modify TALER_EXCHANGE_deposits_get() API to combine returned arguments into a struct (simplifies merchant later), gnunet, 2020/07/05
- [taler-exchange] 26/152: towards changing timestamp in deposit confirmation (tests failing), gnunet, 2020/07/05
- [taler-exchange] 29/152: merge, gnunet, 2020/07/05
- [taler-exchange] 30/152: use unregister, gnunet, 2020/07/05
- [taler-exchange] 32/152: v8 bump, gnunet, 2020/07/05
- [taler-exchange] 46/152: modify TALER_EXCHANGE_deposits_get() API to avoid NULL pointers and need for deep copies, gnunet, 2020/07/05
- [taler-exchange] 42/152: return fee as well,
gnunet <=
- [taler-exchange] 44/152: sleep to ensure aggregator has work, gnunet, 2020/07/05
- [taler-exchange] 47/152: return fee as well, gnunet, 2020/07/05
- [taler-exchange] 48/152: update, gnunet, 2020/07/05
- [taler-exchange] 43/152: towards changing timestamp in deposit confirmation (tests failing), gnunet, 2020/07/05
- [taler-exchange] 52/152: fix drop call, gnunet, 2020/07/05
- [taler-exchange] 51/152: merge, gnunet, 2020/07/05
- [taler-exchange] 54/152: ecs, gnunet, 2020/07/05
- [taler-exchange] 56/152: update ECs, gnunet, 2020/07/05
- [taler-exchange] 61/152: bringing gana up to date so uncrustify accepts taler_error_codes.h, gnunet, 2020/07/05
- [taler-exchange] 59/152: fixed endianness in taler_sq_lib, gnunet, 2020/07/05