diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-06-21 23:52:30 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-06-21 23:52:30 +0200 |
commit | 5d3bfab13a189a5f8a94ccadf257a6a612e618dc (patch) | |
tree | 696f6b036c78044f057ea77ca7754744f7dc8dfa /src/backend/taler-merchant-httpd_private-get-orders-ID.c | |
parent | e5c81bcae0e402877fc9b6c54f91ef9ef3267b67 (diff) | |
download | merchant-5d3bfab13a189a5f8a94ccadf257a6a612e618dc.tar.gz merchant-5d3bfab13a189a5f8a94ccadf257a6a612e618dc.tar.bz2 merchant-5d3bfab13a189a5f8a94ccadf257a6a612e618dc.zip |
add missing notifications to private-get-orders long poller
Diffstat (limited to 'src/backend/taler-merchant-httpd_private-get-orders-ID.c')
-rw-r--r-- | src/backend/taler-merchant-httpd_private-get-orders-ID.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/backend/taler-merchant-httpd_private-get-orders-ID.c b/src/backend/taler-merchant-httpd_private-get-orders-ID.c index d413f71b..e983273a 100644 --- a/src/backend/taler-merchant-httpd_private-get-orders-ID.c +++ b/src/backend/taler-merchant-httpd_private-get-orders-ID.c @@ -25,6 +25,8 @@ #include <taler/taler_json_lib.h> #include "taler-merchant-httpd_mhd.h" #include "taler-merchant-httpd_exchanges.h" +#include "taler-merchant-httpd_private-get-orders.h" + /** * How long do we wait on the exchange? @@ -1084,11 +1086,37 @@ TMH_private_get_orders_ID (const struct TMH_RequestHandler *rh, TALER_amount_cmp (&expect_total, &gorc->deposits_total)) { + struct GNUNET_TIME_Absolute timestamp; + /* expect_total <= gorc->deposits_total: good: we got paid */ wired = true; qs = TMH_db->mark_order_wired (TMH_db->cls, gorc->order_serial); GNUNET_break (qs >= 0); /* just warn if transaction failed */ + { + struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_absolute_time ("timestamp", + ×tamp), + GNUNET_JSON_spec_end () + }; + enum GNUNET_GenericReturnValue res; + + res = TALER_MHD_parse_internal_json_data (connection, + gorc->contract_terms, + spec); + if (GNUNET_YES != res) + { + GNUNET_break (0); + return res; + } + } + TMH_notify_order_change (hc->instance, + hc->infix, + true, /* paid */ + false, /* technically unknown, but OK here */ + true, /* wired */ + timestamp, + gorc->order_serial); } } |