merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit d02180611d985512a98d650da5be7a62d61460fc
parent c27e45b30a6e82276053a068bc09938154cfe70e
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 31 Jan 2026 22:24:46 +0100

implement API extension for #10775

Diffstat:
Msrc/backend/taler-merchant-httpd_private-get-orders-ID.c | 7+++++--
Msrc/backend/taler-merchant-reconciliation.c | 4+++-
Msrc/backenddb/pg_lookup_transfer_details_by_order.c | 15+++++++++++++--
Msrc/backenddb/test_merchantdb.c | 3++-
Msrc/include/taler_merchantdb_plugin.h | 5++++-
5 files changed, 27 insertions(+), 7 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 @@ -1420,7 +1420,8 @@ process_transfer_details ( struct GNUNET_TIME_Timestamp execution_time, const struct TALER_Amount *deposit_value, const struct TALER_Amount *deposit_fee, - bool transfer_confirmed) + bool transfer_confirmed, + uint64_t expected_credit_serial) { struct GetOrderRequestContext *gorc = cls; json_t *wire_details = gorc->wire_details; @@ -1463,7 +1464,9 @@ process_transfer_details ( GNUNET_JSON_pack_timestamp ("execution_time", execution_time), GNUNET_JSON_pack_bool ("confirmed", - transfer_confirmed)))); + transfer_confirmed), + GNUNET_JSON_pack_uint64 ("expected_transfer_serial_id", + expected_credit_serial)))); } diff --git a/src/backend/taler-merchant-reconciliation.c b/src/backend/taler-merchant-reconciliation.c @@ -334,7 +334,9 @@ sync_keys (struct Exchange *e) } if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) { - GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Cannot launch inquiries at `%s': lacking /keys response\n", + e->exchange_url); return; } TALER_EXCHANGE_keys_decref (e->keys); diff --git a/src/backenddb/pg_lookup_transfer_details_by_order.c b/src/backenddb/pg_lookup_transfer_details_by_order.c @@ -76,6 +76,7 @@ lookup_transfer_details_by_order_cb (void *cls, struct TALER_Amount last_deposit_value; struct TALER_Amount last_deposit_fee; bool last_confirmed; + uint64_t last_expected_credit_serial; for (unsigned int i = 0; i<num_results; i++) { @@ -85,6 +86,7 @@ lookup_transfer_details_by_order_cb (void *cls, struct TALER_Amount deposit_value; struct TALER_Amount deposit_fee; bool confirmed; + uint64_t expected_credit_serial; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_timestamp ("deposit_timestamp", &execution_time), @@ -94,6 +96,8 @@ lookup_transfer_details_by_order_cb (void *cls, &confirmed), GNUNET_PQ_result_spec_auto_from_type ("wtid", &wtid), + GNUNET_PQ_result_spec_uint64 ("expected_credit_serial", + &expected_credit_serial), TALER_PQ_result_spec_amount_with_currency ("exchange_deposit_value", &deposit_value), TALER_PQ_result_spec_amount_with_currency ("exchange_deposit_fee", @@ -118,6 +122,7 @@ lookup_transfer_details_by_order_cb (void *cls, last_deposit_value = deposit_value; last_deposit_fee = deposit_fee; last_confirmed = confirmed; + last_expected_credit_serial = expected_credit_serial; continue; } if ( (0 == @@ -125,6 +130,8 @@ lookup_transfer_details_by_order_cb (void *cls, &last_wtid)) && (0 == strcmp (exchange_url, last_exchange_url)) && + (expected_credit_serial == + last_expected_credit_serial) && (GNUNET_TIME_timestamp_cmp (execution_time, ==, last_execution_time)) && @@ -149,7 +156,8 @@ lookup_transfer_details_by_order_cb (void *cls, last_execution_time, &last_deposit_value, &last_deposit_fee, - last_confirmed); + last_confirmed, + last_expected_credit_serial); GNUNET_free (exchange_url); last_wtid = wtid; last_exchange_url = exchange_url; @@ -157,6 +165,7 @@ lookup_transfer_details_by_order_cb (void *cls, last_deposit_value = deposit_value; last_deposit_fee = deposit_fee; last_confirmed = confirmed; + last_expected_credit_serial = expected_credit_serial; } if (num_results > 0) { @@ -166,7 +175,8 @@ lookup_transfer_details_by_order_cb (void *cls, last_execution_time, &last_deposit_value, &last_deposit_fee, - last_confirmed); + last_confirmed, + last_expected_credit_serial); } GNUNET_free (last_exchange_url); ltdo->qs = num_results; @@ -203,6 +213,7 @@ TMH_PG_lookup_transfer_details_by_order ( ",mtc.exchange_deposit_fee" ",mcon.deposit_timestamp" ",met.confirmed" + ",met.expected_credit_serial" " FROM merchant_expected_transfer_to_coin mtc" " JOIN merchant_deposits md" " USING (deposit_serial)" diff --git a/src/backenddb/test_merchantdb.c b/src/backenddb/test_merchantdb.c @@ -3866,7 +3866,8 @@ lookup_transfer_details_order_cb ( struct GNUNET_TIME_Timestamp execution_time, const struct TALER_Amount *deposit_value, const struct TALER_Amount *deposit_fee, - bool transfer_confirmed) + bool transfer_confirmed, + uint64_t expected_transfer_serial_id) { struct TestLookupTransferDetailsByOrder_Closure *cmp = cls; diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h @@ -1068,6 +1068,8 @@ typedef void * @param deposit_fee deposit fee charged by the exchange for the coin * @param transfer_confirmed did the merchant confirm that a wire transfer with * @a wtid over the total amount happened? + * @param expected_credit_serial row of the expected wire transfer, usable + * as ``offset`` for the ``/private/incoming`` endpoint */ typedef void (*TALER_MERCHANTDB_OrderTransferDetailsCallback)( @@ -1077,7 +1079,8 @@ typedef void struct GNUNET_TIME_Timestamp execution_time, const struct TALER_Amount *deposit_value, const struct TALER_Amount *deposit_fee, - bool transfer_confirmed); + bool transfer_confirmed, + uint64_t expected_credit_serial); /**