diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-04-05 17:15:58 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-04-05 17:15:58 +0200 |
commit | 58f1ae25c69e0e378af2c45b929c8bbf7d5c1b2a (patch) | |
tree | ef9625d7929245f48d0142a658a702ca758399bd /src/lib | |
parent | 69131a3253264dd8e7b595f4dd985c5ad8a8e2de (diff) | |
download | merchant-58f1ae25c69e0e378af2c45b929c8bbf7d5c1b2a.tar.gz merchant-58f1ae25c69e0e378af2c45b929c8bbf7d5c1b2a.tar.bz2 merchant-58f1ae25c69e0e378af2c45b929c8bbf7d5c1b2a.zip |
adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional() changed
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/merchant_api_get_reserve.c | 10 | ||||
-rw-r--r-- | src/lib/merchant_api_get_transfers.c | 9 | ||||
-rw-r--r-- | src/lib/merchant_api_merchant_get_order.c | 9 | ||||
-rw-r--r-- | src/lib/merchant_api_post_orders.c | 11 |
4 files changed, 24 insertions, 15 deletions
diff --git a/src/lib/merchant_api_get_reserve.c b/src/lib/merchant_api_get_reserve.c index 3d8f9cbf..cc6bc562 100644 --- a/src/lib/merchant_api_get_reserve.c +++ b/src/lib/merchant_api_get_reserve.c @@ -100,17 +100,19 @@ handle_reserve_get_finished (void *cls, const char *payto_uri = NULL; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_timestamp ("creation_time", - &rs.creation_time), + &rs.creation_time), GNUNET_JSON_spec_timestamp ("expiration_time", - &rs.expiration_time), + &rs.expiration_time), GNUNET_JSON_spec_bool ("active", &active), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("exchange_url", - &exchange_url)), + &exchange_url), + NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("payto_uri", - &payto_uri)), + &payto_uri), + NULL), TALER_JSON_spec_amount_any ("merchant_initial_amount", &rs.merchant_initial_amount), TALER_JSON_spec_amount_any ("exchange_initial_amount", diff --git a/src/lib/merchant_api_get_transfers.c b/src/lib/merchant_api_get_transfers.c index 0d061498..8938c3d7 100644 --- a/src/lib/merchant_api_get_transfers.c +++ b/src/lib/merchant_api_get_transfers.c @@ -145,13 +145,16 @@ handle_transfers_get_finished (void *cls, &td->credit_serial), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_timestamp ("execution_time", - &td->execution_time)), + &td->execution_time), + NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_bool ("verified", - &td->verified)), + &td->verified), + NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_bool ("confirmed", - &td->confirmed)), + &td->confirmed), + NULL), GNUNET_JSON_spec_end () }; diff --git a/src/lib/merchant_api_merchant_get_order.c b/src/lib/merchant_api_merchant_get_order.c index aedeb366..0bb6b6c4 100644 --- a/src/lib/merchant_api_merchant_get_order.c +++ b/src/lib/merchant_api_merchant_get_order.c @@ -86,13 +86,14 @@ handle_unpaid (struct TALER_MERCHANT_OrderMerchantGetHandle *omgh, &osr.details.unpaid.contract_amount), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("already_paid_order_id", - &osr.details.unpaid.already_paid_order_id)), + &osr.details.unpaid.already_paid_order_id), + NULL), GNUNET_JSON_spec_string ("taler_pay_uri", &osr.details.unpaid.taler_pay_uri), GNUNET_JSON_spec_string ("summary", &osr.details.unpaid.summary), GNUNET_JSON_spec_timestamp ("creation_time", - &osr.details.unpaid.creation_time), + &osr.details.unpaid.creation_time), GNUNET_JSON_spec_end () }; @@ -250,7 +251,7 @@ handle_paid (struct TALER_MERCHANT_OrderMerchantGetHandle *omgh, GNUNET_JSON_spec_fixed_auto ("wtid", &wt->wtid), GNUNET_JSON_spec_timestamp ("execution_time", - &wt->execution_time), + &wt->execution_time), TALER_JSON_spec_amount_any ("amount", &wt->total_amount), GNUNET_JSON_spec_bool ("confirmed", @@ -325,7 +326,7 @@ handle_paid (struct TALER_MERCHANT_OrderMerchantGetHandle *omgh, GNUNET_JSON_spec_string ("reason", &ro->reason), GNUNET_JSON_spec_timestamp ("timestamp", - &ro->refund_time), + &ro->refund_time), GNUNET_JSON_spec_end () }; diff --git a/src/lib/merchant_api_post_orders.c b/src/lib/merchant_api_post_orders.c index ff142cde..c4ccea36 100644 --- a/src/lib/merchant_api_post_orders.c +++ b/src/lib/merchant_api_post_orders.c @@ -92,7 +92,7 @@ handle_post_order_finished (void *cls, .hr.http_status = (unsigned int) response_code, .hr.reply = json }; - struct TALER_ClaimTokenP token = {0}; + struct TALER_ClaimTokenP token; po->job = NULL; switch (response_code) @@ -102,12 +102,14 @@ handle_post_order_finished (void *cls, break; case MHD_HTTP_OK: { + bool no_token; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("order_id", &por.details.ok.order_id), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("token", - &token)), + &token), + &no_token), GNUNET_JSON_spec_end () }; @@ -122,7 +124,7 @@ handle_post_order_finished (void *cls, } else { - if (! GNUNET_is_zero (&token)) + if (! no_token) por.details.ok.token = &token; } } @@ -177,7 +179,8 @@ handle_post_order_finished (void *cls, GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_timestamp ( "restock_expected", - &por.details.gone.restock_expected)), + &por.details.gone.restock_expected), + NULL), GNUNET_JSON_spec_end () }; |