commit 32ba3f5b88c5c6036177377a5e3ca6fd40e58dd4
parent 742922dc724660a8a1dc2a7c69e02c23acb0d4d8
Author: bohdan-potuzhnyi <bohdan.potuzhnyi@gmail.com>
Date: Mon, 23 Jun 2025 14:25:55 +0200
prep to test the new pay interface
Diffstat:
1 file changed, 55 insertions(+), 0 deletions(-)
diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c
@@ -33,6 +33,7 @@
#include <taler/taler_testing_lib.h>
#include <taler/taler_signatures.h>
#include "taler_merchant_service.h"
+#include "taler_merchant_pay_service.h"
#include "taler_merchant_testing_lib.h"
#ifdef HAVE_DONAU_DONAU_SERVICE_H
@@ -1225,6 +1226,7 @@ pay_run (void *cls,
&h_proposal))
TALER_TESTING_FAIL (is);
ps->h_contract_terms = *h_proposal;
+ //TODO: Most probably that's the thing we would like to replace with our own implementation of the pay_function
ps->oph = TALER_MERCHANT_order_pay (
TALER_TESTING_interpreter_get_context (is),
ps->merchant_url,
@@ -1248,6 +1250,58 @@ pay_run (void *cls,
output_tokens,
&pay_cb,
ps);
+ // New logic of setting params
+// {
+// struct GNUNET_CURL_Context *ctx =
+// TALER_TESTING_interpreter_get_context (is);
+//
+// ps->oph = TALER_MERCHANT_order_pay_create (ctx,
+// &pay_cb,
+// ps);
+//
+// if (NULL == ps->oph)
+// TALER_TESTING_FAIL (is);
+//
+// /* build the option array ------------------------------------------------ */
+// struct TALER_MERCHANT_OrderPayOption opts[32];
+// size_t oi = 0;
+//
+// #define ADD(_opt) opts[oi++] = (_opt)
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_MERCHANT_URL (ps->merchant_url));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_ORDER_ID (order_id));
+// if (NULL != ps->session_id)
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_SESSION_ID (ps->session_id));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_H_CONTRACT (h_proposal));
+// if (ps->choice_index >= 0)
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_CHOICE_INDEX(ps->choice_index));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_AMOUNT (&ps->total_amount));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_MAX_FEE (&max_fee));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_MERCHANT_PUB (&merchant_pub));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_TIMESTAMP (timestamp));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_REFUND_DEADLINE(refund_deadline));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_PAY_DEADLINE (pay_deadline));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_H_WIRE (&h_wire));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_COINS (npay_coins,
+// pay_coins));
+// if (len_use_tokens > 0)
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_INPUT_TOKENS(len_use_tokens,
+// use_tokens));
+// if (len_output_tokens > 0)
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_OUTPUT_TOKENS(len_output_tokens,
+// output_tokens));
+// ADD (TALER_MERCHANT_ORDER_PAY_OPTION_TERMINATE ());
+// #undef ADD
+//
+// if (TALER_MERCHANT_OPOEC_OK !=
+// TALER_MERCHANT_order_pay_set_options (ps->oph,
+// opts,
+// oi))
+// TALER_TESTING_FAIL (is);
+//
+// if (TALER_MERCHANT_OPOEC_OK !=
+// TALER_MERCHANT_order_pay_start (ps->oph))
+// TALER_TESTING_FAIL (is);
+// }
GNUNET_array_grow (pay_coins,
npay_coins,
0);
@@ -1275,6 +1329,7 @@ pay_cleanup (void *cls,
TALER_TESTING_interpreter_get_current_label (
ps->is));
TALER_MERCHANT_order_pay_cancel (ps->oph);
+ //TALER_MERCHANT_order_pay_cancel1 (ps->oph);
}
GNUNET_free (ps);