aboutsummaryrefslogtreecommitdiff
path: root/src/merchant-tools/taler-merchant-generate-payments_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/merchant-tools/taler-merchant-generate-payments_new.c')
-rw-r--r--src/merchant-tools/taler-merchant-generate-payments_new.c63
1 files 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 cc7bb0f8..202f3c81 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,
126 126
127 CMD_TRANSFER_TO_EXCHANGE 127 CMD_TRANSFER_TO_EXCHANGE
128 ("create-reserve-1", 128 ("create-reserve-1",
129 "USD:15.03"), 129 "USD:25.05"),
130 130
131 TALER_TESTING_cmd_exec_wirewatch 131 TALER_TESTING_cmd_exec_wirewatch
132 ("wirewatch-1", 132 ("wirewatch-1",
@@ -134,7 +134,7 @@ run (void *cls,
134 134
135 TALER_TESTING_cmd_withdraw_amount 135 TALER_TESTING_cmd_withdraw_amount
136 ("withdraw-coin-1", 136 ("withdraw-coin-1",
137 is->exchange, 137 is->exchange, // picks port from config's [exchange].
138 "create-reserve-1", 138 "create-reserve-1",
139 "USD:5", 139 "USD:5",
140 MHD_HTTP_OK), 140 MHD_HTTP_OK),
@@ -155,6 +155,23 @@ run (void *cls,
155 "USD:5", 155 "USD:5",
156 MHD_HTTP_OK), 156 MHD_HTTP_OK),
157 157
158 /* coin 4 & 5 will be deposited for the same
159 * contract; needed in case some testing utility
160 * wants to trigger a "failed dependency" error. */
161 TALER_TESTING_cmd_withdraw_amount
162 ("withdraw-coin-4",
163 is->exchange,
164 "create-reserve-1",
165 "USD:5",
166 MHD_HTTP_OK),
167
168 TALER_TESTING_cmd_withdraw_amount
169 ("withdraw-coin-5",
170 is->exchange,
171 "create-reserve-1",
172 "USD:5",
173 MHD_HTTP_OK),
174
158 TALER_TESTING_cmd_proposal 175 TALER_TESTING_cmd_proposal
159 ("create-proposal-1", 176 ("create-proposal-1",
160 merchant_url, 177 merchant_url,
@@ -187,6 +204,42 @@ run (void *cls,
187 "USD:4.99", 204 "USD:4.99",
188 "USD:0.01"), 205 "USD:0.01"),
189 206
207 /* Doing the 2-coins payment; needed to generate the
208 * "failed dependency" response error, at /track/transaction.
209 * NOTE: not used here, but done just in case a testing
210 * program would need it. */
211 TALER_TESTING_cmd_proposal
212 ("create-proposal-4&5",
213 merchant_url,
214 is->ctx,
215 MHD_HTTP_OK,
216 "{\"max_fee\":\
217 {\"currency\":\"USD\",\
218 \"value\":0,\
219 \"fraction\":50000000},\
220 \"refund_deadline\":\"\\/Date(0)\\/\",\
221 \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
222 \"amount\":\
223 {\"currency\":\"USD\",\
224 \"value\":10,\
225 \"fraction\":0},\
226 \"summary\": \"2-coins payment\",\
227 \"fulfillment_url\": \"https://example.com/\",\
228 \"products\": [ {\"description\":\"2-coins payment\",\
229 \"value\":\"{USD:10}\"} ] }",
230 NULL),
231
232 TALER_TESTING_cmd_pay ("deposit-4&5",
233 merchant_url,
234 is->ctx,
235 MHD_HTTP_OK,
236 "create-proposal-4&5",
237 "withdraw-coin-4;" \
238 "withdraw-coin-5",
239 "EUR:10",
240 "EUR:9.98", // no sense now
241 "EUR:0.02"), // no sense now
242
190 TALER_TESTING_cmd_rewind_ip 243 TALER_TESTING_cmd_rewind_ip
191 ("rewind-payments", 244 ("rewind-payments",
192 FIRST_INSTRUCTION, 245 FIRST_INSTRUCTION,
@@ -419,7 +472,7 @@ main (int argc,
419 } 472 }
420 473
421 if (NULL == (merchantd = TALER_TESTING_run_merchant 474 if (NULL == (merchantd = TALER_TESTING_run_merchant
422 (default_config_file, merchant_url))) 475 (cfg_filename, merchant_url)))
423 { 476 {
424 TALER_LOG_ERROR ("Failed to launch the merchant\n"); 477 TALER_LOG_ERROR ("Failed to launch the merchant\n");
425 terminate_process (merchantd); 478 terminate_process (merchantd);
@@ -433,7 +486,7 @@ main (int argc,
433 } 486 }
434 487
435 if ( NULL == (bankd = TALER_TESTING_run_bank 488 if ( NULL == (bankd = TALER_TESTING_run_bank
436 (default_config_file, 489 (cfg_filename,
437 bank_url))) 490 bank_url)))
438 { 491 {
439 TALER_LOG_ERROR ("Failed to run the bank\n"); 492 TALER_LOG_ERROR ("Failed to run the bank\n");
@@ -445,7 +498,7 @@ main (int argc,
445 result = TALER_TESTING_setup_with_exchange 498 result = TALER_TESTING_setup_with_exchange
446 (run, 499 (run,
447 NULL, 500 NULL,
448 default_config_file); 501 cfg_filename);
449 502
450 terminate_process (merchantd); 503 terminate_process (merchantd);
451 terminate_process (bankd); 504 terminate_process (bankd);