summaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_wallet_get_order.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/merchant_api_wallet_get_order.c')
-rw-r--r--src/lib/merchant_api_wallet_get_order.c47
1 files changed, 11 insertions, 36 deletions
diff --git a/src/lib/merchant_api_wallet_get_order.c b/src/lib/merchant_api_wallet_get_order.c
index 61bed534..763b2c83 100644
--- a/src/lib/merchant_api_wallet_get_order.c
+++ b/src/lib/merchant_api_wallet_get_order.c
@@ -116,11 +116,11 @@ handle_wallet_get_order_finished (void *cls,
};
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_bool ("refunded",
- &owgr.details.success.refunded),
+ &owgr.details.ok.refunded),
GNUNET_JSON_spec_bool ("refund_pending",
- &owgr.details.success.refund_pending),
+ &owgr.details.ok.refund_pending),
TALER_JSON_spec_amount_any ("refund_amount",
- &owgr.details.success.refund_amount),
+ &owgr.details.ok.refund_amount),
GNUNET_JSON_spec_end ()
};
@@ -205,8 +205,7 @@ TALER_MERCHANT_wallet_order_get (
void *cb_cls)
{
struct TALER_MERCHANT_OrderWalletGetHandle *owgh;
- unsigned long long tms;
- long tlong;
+ unsigned int tms;
GNUNET_assert (NULL != backend_url);
GNUNET_assert (NULL != order_id);
@@ -214,14 +213,8 @@ TALER_MERCHANT_wallet_order_get (
owgh->ctx = ctx;
owgh->cb = cb;
owgh->cb_cls = cb_cls;
- tms = (unsigned long long) (timeout.rel_value_us
- / GNUNET_TIME_UNIT_MILLISECONDS.rel_value_us);
- /* set curl timeout to *our* long poll timeout plus one minute
- (for network latency and processing delays) */
- tlong = (long) (GNUNET_TIME_relative_add (timeout,
- GNUNET_TIME_UNIT_MINUTES).
- rel_value_us
- / GNUNET_TIME_UNIT_MILLISECONDS.rel_value_us);
+ tms = (unsigned int) (timeout.rel_value_us
+ / GNUNET_TIME_UNIT_MILLISECONDS.rel_value_us);
{
char timeout_ms[32];
struct GNUNET_CRYPTO_HashAsciiEncoded h_contract_s;
@@ -231,7 +224,7 @@ TALER_MERCHANT_wallet_order_get (
&h_contract_s);
GNUNET_snprintf (timeout_ms,
sizeof (timeout_ms),
- "%llu",
+ "%u",
tms);
GNUNET_asprintf (&path,
"orders/%s",
@@ -271,28 +264,10 @@ TALER_MERCHANT_wallet_order_get (
eh = TALER_MERCHANT_curl_easy_get_ (owgh->url);
if (0 != tms)
{
- if (CURLE_OK !=
- curl_easy_setopt (eh,
- CURLOPT_TIMEOUT_MS,
- (long) tms))
- {
- GNUNET_break (0);
- curl_easy_cleanup (eh);
- GNUNET_free (owgh->url);
- GNUNET_free (owgh);
- return NULL;
- }
- }
- if (CURLE_OK !=
- curl_easy_setopt (eh,
- CURLOPT_TIMEOUT_MS,
- tlong))
- {
- GNUNET_break (0);
- curl_easy_cleanup (eh);
- GNUNET_free (owgh->url);
- GNUNET_free (owgh);
- return NULL;
+ GNUNET_break (CURLE_OK ==
+ curl_easy_setopt (eh,
+ CURLOPT_TIMEOUT_MS,
+ (long) (tms + 100L)));
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,