commit 9b9a3e49b9ca473bcd16ecd3b92074dfc8dd0633
parent 2263b81db99f9b43f60a67836cd0722aa25398ea
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date: Tue, 24 Feb 2026 02:42:39 +0100
some work on the #0011139
Diffstat:
2 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/src/backenddb/pg_insert_transfer_details.sql b/src/backenddb/pg_insert_transfer_details.sql
@@ -238,12 +238,17 @@ LOOP
,webhook_serial
,url
,http_method
+ ,header
,body)
SELECT mw.merchant_serial
,mw.webhook_serial
,mw.url
,mw.http_method
,replace_placeholder(
+ replace_placeholder(mw.header_template, 'order_id', my_order_id),
+ 'wtid', encode(in_wtid, 'hex')
+ )::TEXT
+ ,replace_placeholder(
replace_placeholder(mw.body_template, 'order_id', my_order_id),
'wtid', encode(in_wtid, 'hex')
)::TEXT
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
@@ -454,6 +454,15 @@ run (void *cls,
"webhook-pay-1",
"pay",
MHD_HTTP_NO_CONTENT),
+ TALER_TESTING_cmd_merchant_post_webhooks2 ("post-webhooks-settled-w1",
+ merchant_url,
+ "webhook-settled-1",
+ "order_settled",
+ "http://localhost:12345/",
+ "POST",
+ "Taler-test-header: settled",
+ "order-settled",
+ MHD_HTTP_NO_CONTENT),
TALER_TESTING_cmd_testserver ("launch-http-server-for-webhooks",
12345),
TALER_TESTING_cmd_merchant_post_orders2 ("create-proposal-1-idem",
@@ -626,6 +635,15 @@ run (void *cls,
config_file),
TALER_TESTING_cmd_run_tme ("run taler-merchant-reconciliation-1",
config_file),
+ /* Check for settled webhook after reconciliation */
+ cmd_webhook ("pending-webhooks-settled-w1"),
+ TALER_TESTING_cmd_checkserver2 ("check-http-server-for-settled-webhook",
+ "launch-http-server-for-webhooks",
+ 1,
+ "/",
+ "POST",
+ "settled",
+ "order-settled"),
TALER_TESTING_cmd_merchant_post_transfer2 ("post-transfer-bad",
merchant_url,
merchant_payto,
@@ -1178,6 +1196,10 @@ run (void *cls,
merchant_url,
"webhook-pay-1",
MHD_HTTP_NO_CONTENT),
+ TALER_TESTING_cmd_merchant_delete_webhook ("post-webhooks-settled-w1",
+ merchant_url,
+ "webhook-settled-1",
+ MHD_HTTP_NO_CONTENT),
TALER_TESTING_cmd_check_bank_empty ("check_bank_empty-2"),
TALER_TESTING_cmd_end ()
};