[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-sync] branch master updated: adapt to latest merchant API
From: |
gnunet |
Subject: |
[taler-sync] branch master updated: adapt to latest merchant API |
Date: |
Mon, 06 Apr 2020 19:55:07 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository sync.
The following commit(s) were added to refs/heads/master by this push:
new b2efa7c adapt to latest merchant API
b2efa7c is described below
commit b2efa7c110f9fd172b7fee40eecf14fee1f09ca6
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Apr 6 19:55:05 2020 +0200
adapt to latest merchant API
---
src/sync/sync-httpd_backup_post.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
diff --git a/src/sync/sync-httpd_backup_post.c
b/src/sync/sync-httpd_backup_post.c
index ff055a0..70d19df 100644
--- a/src/sync/sync-httpd_backup_post.c
+++ b/src/sync/sync-httpd_backup_post.c
@@ -245,17 +245,12 @@ make_payment_request (const char *order_id)
* /contract request to a merchant.
*
* @param cls our `struct BackupContext`
- * @param http_status HTTP response code, 200 indicates success;
- * 0 if the backend's reply is bogus (fails to follow the
protocol)
- * @param ec taler-specific error code
- * @param obj raw JSON reply, or error details if the request failed
+ * @param hr HTTP response details
* @param order_id order id of the newly created order
*/
static void
proposal_cb (void *cls,
- unsigned int http_status,
- enum TALER_ErrorCode ec,
- const json_t *obj,
+ const struct TALER_MERCHANT_HttpResponse *hr,
const char *order_id)
{
struct BackupContext *bc = cls;
@@ -270,24 +265,27 @@ proposal_cb (void *cls,
bc);
MHD_resume_connection (bc->con);
SH_trigger_daemon ();
- if (MHD_HTTP_OK != http_status)
+ if (MHD_HTTP_OK != hr->http_status)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Backend returned status %u/%u\n",
- http_status,
- (unsigned int) ec);
+ hr->http_status,
+ (unsigned int) hr->ec);
GNUNET_break (0);
- bc->resp = TALER_MHD_make_json_pack ("{s:I, s:s, s:I, s:I}",
+ bc->resp = TALER_MHD_make_json_pack ("{s:I, s:s, s:I, s:I, s:O}",
"code",
(json_int_t)
TALER_EC_SYNC_PAYMENT_CREATE_BACKEND_ERROR,
"hint",
"Failed to setup order with merchant
backend",
- "backend-ec", (json_int_t) ec,
+ "backend-ec",
+ (json_int_t) hr->ec,
"backend-http-status",
- (json_int_t) http_status);
+ (json_int_t) hr->http_status,
+ "backend-reply",
+ hr->reply);
GNUNET_assert (NULL != bc->resp);
- bc->response_code = MHD_HTTP_INTERNAL_SERVER_ERROR;
+ bc->response_code = MHD_HTTP_FAILED_DEPENDENCY;
return;
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -350,8 +348,7 @@ ongoing_payment_cb (void *cls,
* Callback to process a GET /check-payment request
*
* @param cls our `struct BackupContext`
- * @param http_status HTTP status code for this request
- * @param obj raw response body
+ * @param hr HTTP response details
* @param paid #GNUNET_YES if the payment is settled, #GNUNET_NO if not
* settled, $GNUNET_SYSERR on error
* (note that refunded payments are returned as paid!)
@@ -364,8 +361,7 @@ ongoing_payment_cb (void *cls,
*/
static void
check_payment_cb (void *cls,
- unsigned int http_status,
- const json_t *obj,
+ const struct TALER_MERCHANT_HttpResponse *hr,
int paid,
int refunded,
struct TALER_Amount *refund_amount,
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-sync] branch master updated: adapt to latest merchant API,
gnunet <=