summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/test_merchant_api.c4
-rw-r--r--src/testing/testing_api_cmd_pay_order.c11
-rw-r--r--src/testing/testing_api_cmd_post_using_templates.c20
3 files changed, 14 insertions, 21 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c
index 9d828c12..b7d8518e 100644
--- a/src/testing/test_merchant_api.c
+++ b/src/testing/test_merchant_api.c
@@ -1445,8 +1445,8 @@ run (void *cls,
MHD_HTTP_OK,
"using-templates-t1",
"withdraw-coin-10a;withdraw-coin-10b",
- "EUR:5",
- "EUR:4.99",
+ "EUR:10",
+ "EUR:9",
NULL),
TALER_TESTING_cmd_merchant_delete_template ("get-templates-empty",
merchant_url,
diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c
index c1c5fc5a..8077f375 100644
--- a/src/testing/testing_api_cmd_pay_order.c
+++ b/src/testing/testing_api_cmd_pay_order.c
@@ -95,6 +95,7 @@ struct PayState
/**
* This variable is for the verification of the payment.
*/
+ const char *pos_key;
const char *pos_confirmation;
};
@@ -263,6 +264,15 @@ pay_cb (void *cls,
GNUNET_TIME_timestamp_get());*/
// FIXME: check if pr->details.success.pos_confirmation;
// for that, get pos_secret from ps->proposal_reference CMD and amount from pay/order creation cmd using traits
+ struct TALER_Amount amount_with_fee;
+ GNUNET_assert (GNUNET_OK ==
+ TALER_string_to_amount (ps->amount_with_fee,
+ &amount_with_fee));
+ ps->pos_confirmation = TALER_build_pos_confirmation (ps->pos_key,
+ TALER_MCA_WITHOUT_PRICE,
+ &amount_with_fee,
+ GNUNET_TIME_timestamp_get());
+ ps->pos_confirmation = pr->details.success.pos_confirmation;
}
TALER_TESTING_interpreter_next (ps->is);
}
@@ -496,6 +506,7 @@ pay_traits (void *cls,
TALER_TESTING_make_trait_merchant_pub (merchant_pub),
TALER_TESTING_make_trait_merchant_sig (&ps->merchant_sig),
TALER_TESTING_make_trait_amount (&amount_with_fee),
+ TALER_TESTING_make_trait_template_pos_key (&ps->pos_key),
TALER_TESTING_trait_end ()
};
diff --git a/src/testing/testing_api_cmd_post_using_templates.c b/src/testing/testing_api_cmd_post_using_templates.c
index d8f2c0a9..62473b23 100644
--- a/src/testing/testing_api_cmd_post_using_templates.c
+++ b/src/testing/testing_api_cmd_post_using_templates.c
@@ -233,7 +233,7 @@ post_using_templates_cb (void *cls,
TALER_TESTING_interpreter_next (tis->is);
return;
}
- // check the rest of the function to adapt to using_template
+ // check for order
switch (por->hr.http_status)
{
case MHD_HTTP_OK:
@@ -322,24 +322,6 @@ post_using_templates_cb (void *cls,
&orders_claim_cb,
tis)))
TALER_TESTING_FAIL (tis->is);
-
- /*
- switch (por->hr.http_status)
- {
- case MHD_HTTP_OK:
- break;
- case MHD_HTTP_CONFLICT:
- break;
- case MHD_HTTP_NOT_FOUND:
- break;
- default:
- GNUNET_break (0);
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Unhandled HTTP status %u for POST /templates/$ID.\n",
- por->hr.http_status);
- break;
- }
- TALER_TESTING_interpreter_next (tis->is);*/
}