gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [taler-merchant] 02/02: Properly adding Authorization heade


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 02/02: Properly adding Authorization header via GNUnet API.
Date: Wed, 13 Jun 2018 18:04:07 +0200

This is an automated email from the git hooks/post-receive script.

marcello pushed a commit to branch master
in repository merchant.

commit fc3b858855fc2db22ccbfe81538c77ecfa79f5f8
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Jun 13 18:03:39 2018 +0200

    Properly adding Authorization header via GNUnet API.
---
 src/include/taler_merchant_service.h     | 1 +
 src/lib/merchant_api_pay.c               | 4 ++++
 src/lib/merchant_api_proposal.c          | 5 +++++
 src/lib/merchant_api_track_transaction.c | 4 ++++
 src/lib/merchant_api_track_transfer.c    | 5 +++++
 5 files changed, 19 insertions(+)

diff --git a/src/include/taler_merchant_service.h 
b/src/include/taler_merchant_service.h
index 6c0339f..0f30aab 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -28,6 +28,7 @@
 #include <gnunet/gnunet_curl_lib.h>
 #include <jansson.h>
 
+#define APIKEY_SANDBOX "Authorization: ApiKey sandbox"
 
 /* ********************* /refund ************************** */
 
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c
index 93b6478..44518d7 100644
--- a/src/lib/merchant_api_pay.c
+++ b/src/lib/merchant_api_pay.c
@@ -592,6 +592,10 @@ request_pay_generic (struct GNUNET_CURL_Context *ctx,
                  curl_easy_setopt (eh,
                                    CURLOPT_POSTFIELDSIZE,
                                    strlen (ph->json_enc)));
+  GNUNET_assert
+    (GNUNET_OK == GNUNET_CURL_append_header
+      (ctx, APIKEY_SANDBOX));
+
   ph->job = GNUNET_CURL_job_add (ctx,
                                  eh,
                                  GNUNET_YES,
diff --git a/src/lib/merchant_api_proposal.c b/src/lib/merchant_api_proposal.c
index 72b44fa..47446ee 100644
--- a/src/lib/merchant_api_proposal.c
+++ b/src/lib/merchant_api_proposal.c
@@ -245,6 +245,11 @@ TALER_MERCHANT_order_put (struct GNUNET_CURL_Context *ctx,
                  curl_easy_setopt (eh,
                                    CURLOPT_POSTFIELDSIZE,
                                    strlen (po->json_enc)));
+
+  GNUNET_assert
+    (GNUNET_OK == GNUNET_CURL_append_header
+      (ctx, APIKEY_SANDBOX));
+
   po->job = GNUNET_CURL_job_add (ctx,
                                  eh,
                                  GNUNET_YES,
diff --git a/src/lib/merchant_api_track_transaction.c 
b/src/lib/merchant_api_track_transaction.c
index ae5d903..4336c5a 100644
--- a/src/lib/merchant_api_track_transaction.c
+++ b/src/lib/merchant_api_track_transaction.c
@@ -170,6 +170,10 @@ TALER_MERCHANT_track_transaction (struct 
GNUNET_CURL_Context *ctx,
                  curl_easy_setopt (eh,
                                    CURLOPT_URL,
                                    tdo->url));
+  GNUNET_assert
+    (GNUNET_OK == GNUNET_CURL_append_header
+      (ctx, APIKEY_SANDBOX));
+
   tdo->job = GNUNET_CURL_job_add (ctx,
                                   eh,
                                   GNUNET_YES,
diff --git a/src/lib/merchant_api_track_transfer.c 
b/src/lib/merchant_api_track_transfer.c
index 7c78532..467ffa9 100644
--- a/src/lib/merchant_api_track_transfer.c
+++ b/src/lib/merchant_api_track_transfer.c
@@ -254,6 +254,11 @@ TALER_MERCHANT_track_transfer (struct GNUNET_CURL_Context 
*ctx,
                  curl_easy_setopt (eh,
                                    CURLOPT_URL,
                                    tdo->url));
+
+  GNUNET_assert
+    (GNUNET_OK == GNUNET_CURL_append_header
+      (ctx, APIKEY_SANDBOX));
+
   tdo->job = GNUNET_CURL_job_add (ctx,
                                   eh,
                                   GNUNET_YES,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]