[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: handler for /GET re
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: handler for /GET refund |
Date: |
Mon, 19 Jun 2017 15:40:01 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new 6f0813a handler for /GET refund
6f0813a is described below
commit 6f0813ade5c844c30314047781ac8348da9467c3
Author: Marcello Stanisci <address@hidden>
AuthorDate: Mon Jun 19 15:40:05 2017 +0200
handler for /GET refund
---
src/lib/merchant_api_refund.c | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/src/lib/merchant_api_refund.c b/src/lib/merchant_api_refund.c
index 9a4329b..b93f2cf 100644
--- a/src/lib/merchant_api_refund.c
+++ b/src/lib/merchant_api_refund.c
@@ -108,7 +108,40 @@ handle_refund_increase_finished (void *cls,
long response_code,
const json_t *json)
{
- /* TBD */
+ struct TALER_MERCHANT_RefundIncreaseOperation *rio = cls;
+ char *error;
+ char *hint;
+ enum TALER_ErrorCode code;
+
+ rio->job = NULL;
+ switch (response_code)
+ {
+ case 0:
+ /* Hard error */
+ break;
+ case MHD_HTTP_OK:
+ rio->cb (rio->cb_cls,
+ MHD_HTTP_OK,
+ TALER_EC_NONE,
+ json);
+ break;
+ default:
+ /**
+ * The backend gave response, but it's error, log it.
+ * NOTE that json must be a Taler-specific error object (FIXME,
+ * need a link to error objects at docs)
+ */
+ json_unpack ((json_t *) json,
+ "{s:s, s:I, s:s}",
+ "error", &error,
+ "code", &code,
+ "hint", &hint);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Failed POST /refund, error: %s, code: %d, hint: %s\n",
+ error,
+ code,
+ hint);
+ }
}
/**
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: handler for /GET refund,
gnunet <=