summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-09 13:06:21 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-09 13:06:21 +0100
commite095f81c0acf1ae21874eb50936b30111fefef89 (patch)
tree6b437b5bf5ad3780e8345b58515747eb2d4da740 /src
parentedfc078b18effea43865a093df69e5fcb1c3475d (diff)
downloadmerchant-e095f81c0acf1ae21874eb50936b30111fefef89.tar.gz
merchant-e095f81c0acf1ae21874eb50936b30111fefef89.tar.bz2
merchant-e095f81c0acf1ae21874eb50936b30111fefef89.zip
api update, not fully implemented
Diffstat (limited to 'src')
-rw-r--r--src/include/taler_merchant_service.h6
-rw-r--r--src/lib/merchant_api_check_payment.c5
-rw-r--r--src/lib/testing_api_cmd_check_payment.c19
-rw-r--r--src/merchant-tools/taler-merchant-benchmark.c5
4 files changed, 21 insertions, 14 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 1d424f22..0e36b981 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -28,7 +28,6 @@
#include <gnunet/gnunet_curl_lib.h>
#include <jansson.h>
-#define APIKEY_SANDBOX "Authorization: ApiKey sandbox"
/* ********************* /refund ************************** */
@@ -987,6 +986,10 @@ typedef void
* @param backend_url base URL of the merchant backend
* @param order_id order id to identify the payment
* @parem session_id sesion id for the payment (or NULL if the payment is not bound to a session)
+ * @param timeout timeout to use in long polling (how long may the server wait to reply
+ * before generating an unpaid response). Note that this is just provided to
+ * the server, we as client will block until the response comes back or until
+ * #TALER_MERCHANT_check_payment_cancel() is called.
* @param check_payment_cb callback which will work the response gotten from the backend
* @param check_payment_cb_cls closure to pass to @a check_payment_cb
* @return handle for this operation, NULL upon errors
@@ -996,6 +999,7 @@ TALER_MERCHANT_check_payment (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const char *order_id,
const char *session_id,
+ struct GNUNET_TIME_Relative timeout,
TALER_MERCHANT_CheckPaymentCallback
check_payment_cb,
void *check_payment_cls);
diff --git a/src/lib/merchant_api_check_payment.c b/src/lib/merchant_api_check_payment.c
index 35cd44ce..fe38a18a 100644
--- a/src/lib/merchant_api_check_payment.c
+++ b/src/lib/merchant_api_check_payment.c
@@ -178,6 +178,10 @@ handle_check_payment_finished (void *cls,
* @param backend_url base URL of the merchant backend
* @param order_id order id to identify the payment
* @parem session_id sesion id for the payment (or NULL if the payment is not bound to a session)
+ * @param timeout timeout to use in long polling (how long may the server wait to reply
+ * before generating an unpaid response). Note that this is just provided to
+ * the server, we as client will block until the response comes back or until
+ * #TALER_MERCHANT_poll_payment_cancel() is called.
* @param check_payment_cb callback which will work the response gotten from the backend
* @param check_payment_cb_cls closure to pass to @a check_payment_cb
* @return handle for this operation, NULL upon errors
@@ -187,6 +191,7 @@ TALER_MERCHANT_check_payment (struct GNUNET_CURL_Context *ctx,
const char *backend_url,
const char *order_id,
const char *session_id,
+ struct GNUNET_TIME_Relative timeout,
TALER_MERCHANT_CheckPaymentCallback
check_payment_cb,
void *check_payment_cb_cls)
diff --git a/src/lib/testing_api_cmd_check_payment.c b/src/lib/testing_api_cmd_check_payment.c
index e74dbd12..a942c587 100644
--- a/src/lib/testing_api_cmd_check_payment.c
+++ b/src/lib/testing_api_cmd_check_payment.c
@@ -162,26 +162,21 @@ check_payment_run (void *cls,
cps->is = is;
proposal_cmd = TALER_TESTING_interpreter_lookup_command (
is, cps->proposal_reference);
-
if (NULL == proposal_cmd)
TALER_TESTING_FAIL (is);
-
if (GNUNET_OK != TALER_TESTING_get_trait_order_id (
proposal_cmd, 0, &order_id))
TALER_TESTING_FAIL (is);
-
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Checking for order id `%s'\n",
order_id);
-
- cps->cpo = TALER_MERCHANT_check_payment
- (is->ctx,
- cps->merchant_url,
- order_id,
- NULL,
- check_payment_cb,
- cps);
-
+ cps->cpo = TALER_MERCHANT_check_payment (is->ctx,
+ cps->merchant_url,
+ order_id,
+ NULL,
+ GNUNET_TIME_UNIT_ZERO,
+ check_payment_cb,
+ cps);
GNUNET_assert (NULL != cps->cpo);
}
diff --git a/src/merchant-tools/taler-merchant-benchmark.c b/src/merchant-tools/taler-merchant-benchmark.c
index dedcc220..49c3cdd7 100644
--- a/src/merchant-tools/taler-merchant-benchmark.c
+++ b/src/merchant-tools/taler-merchant-benchmark.c
@@ -23,7 +23,6 @@
* communication with the exchange
* @author Marcello Stanisci
*/
-
#include "platform.h"
#include <taler/taler_util.h>
#include <taler/taler_signatures.h>
@@ -38,6 +37,10 @@
#include <taler/taler_error_codes.h>
#include "taler_merchant_testing_lib.h"
+
+#define APIKEY_SANDBOX "Authorization: ApiKey sandbox"
+
+
/* Error codes. */
enum PaymentGeneratorError
{