[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: Implement 2-coined
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: Implement 2-coined payment. |
Date: |
Wed, 06 Jun 2018 22:08:35 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new e4f8b93 Implement 2-coined payment.
e4f8b93 is described below
commit e4f8b932c992139d2e51f2f192bbb66b399772ec
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Jun 6 22:06:59 2018 +0200
Implement 2-coined payment.
The payment generator has to generate a payment
where two coins are used; this way it's possible
to trigger "failed dependecy" HTTP errors when
testing the back-office site.
---
.../taler-merchant-generate-payments_new.c | 63 ++++++++++++++++++++--
1 file changed, 58 insertions(+), 5 deletions(-)
diff --git a/src/merchant-tools/taler-merchant-generate-payments_new.c
b/src/merchant-tools/taler-merchant-generate-payments_new.c
index cc7bb0f..202f3c8 100644
--- a/src/merchant-tools/taler-merchant-generate-payments_new.c
+++ b/src/merchant-tools/taler-merchant-generate-payments_new.c
@@ -126,7 +126,7 @@ run (void *cls,
CMD_TRANSFER_TO_EXCHANGE
("create-reserve-1",
- "USD:15.03"),
+ "USD:25.05"),
TALER_TESTING_cmd_exec_wirewatch
("wirewatch-1",
@@ -134,7 +134,7 @@ run (void *cls,
TALER_TESTING_cmd_withdraw_amount
("withdraw-coin-1",
- is->exchange,
+ is->exchange, // picks port from config's [exchange].
"create-reserve-1",
"USD:5",
MHD_HTTP_OK),
@@ -155,6 +155,23 @@ run (void *cls,
"USD:5",
MHD_HTTP_OK),
+ /* coin 4 & 5 will be deposited for the same
+ * contract; needed in case some testing utility
+ * wants to trigger a "failed dependency" error. */
+ TALER_TESTING_cmd_withdraw_amount
+ ("withdraw-coin-4",
+ is->exchange,
+ "create-reserve-1",
+ "USD:5",
+ MHD_HTTP_OK),
+
+ TALER_TESTING_cmd_withdraw_amount
+ ("withdraw-coin-5",
+ is->exchange,
+ "create-reserve-1",
+ "USD:5",
+ MHD_HTTP_OK),
+
TALER_TESTING_cmd_proposal
("create-proposal-1",
merchant_url,
@@ -187,6 +204,42 @@ run (void *cls,
"USD:4.99",
"USD:0.01"),
+ /* Doing the 2-coins payment; needed to generate the
+ * "failed dependency" response error, at /track/transaction.
+ * NOTE: not used here, but done just in case a testing
+ * program would need it. */
+ TALER_TESTING_cmd_proposal
+ ("create-proposal-4&5",
+ merchant_url,
+ is->ctx,
+ MHD_HTTP_OK,
+ "{\"max_fee\":\
+ {\"currency\":\"USD\",\
+ \"value\":0,\
+ \"fraction\":50000000},\
+ \"refund_deadline\":\"\\/Date(0)\\/\",\
+ \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
+ \"amount\":\
+ {\"currency\":\"USD\",\
+ \"value\":10,\
+ \"fraction\":0},\
+ \"summary\": \"2-coins payment\",\
+ \"fulfillment_url\": \"https://example.com/\",\
+ \"products\": [ {\"description\":\"2-coins payment\",\
+ \"value\":\"{USD:10}\"} ] }",
+ NULL),
+
+ TALER_TESTING_cmd_pay ("deposit-4&5",
+ merchant_url,
+ is->ctx,
+ MHD_HTTP_OK,
+ "create-proposal-4&5",
+ "withdraw-coin-4;" \
+ "withdraw-coin-5",
+ "EUR:10",
+ "EUR:9.98", // no sense now
+ "EUR:0.02"), // no sense now
+
TALER_TESTING_cmd_rewind_ip
("rewind-payments",
FIRST_INSTRUCTION,
@@ -419,7 +472,7 @@ main (int argc,
}
if (NULL == (merchantd = TALER_TESTING_run_merchant
- (default_config_file, merchant_url)))
+ (cfg_filename, merchant_url)))
{
TALER_LOG_ERROR ("Failed to launch the merchant\n");
terminate_process (merchantd);
@@ -433,7 +486,7 @@ main (int argc,
}
if ( NULL == (bankd = TALER_TESTING_run_bank
- (default_config_file,
+ (cfg_filename,
bank_url)))
{
TALER_LOG_ERROR ("Failed to run the bank\n");
@@ -445,7 +498,7 @@ main (int argc,
result = TALER_TESTING_setup_with_exchange
(run,
NULL,
- default_config_file);
+ cfg_filename);
terminate_process (merchantd);
terminate_process (bankd);
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: Implement 2-coined payment.,
gnunet <=