diff options
author | Marcello Stanisci <stanisci.m@gmail.com> | 2018-06-07 09:55:19 +0200 |
---|---|---|
committer | Marcello Stanisci <stanisci.m@gmail.com> | 2018-06-07 09:55:19 +0200 |
commit | 7e7af4255d1e250041bc1e651cce13eff7f2b728 (patch) | |
tree | b97147afdd274e4c8892db75035f28cb3c7cc697 | |
parent | e4f8b932c992139d2e51f2f192bbb66b399772ec (diff) | |
download | merchant-7e7af4255d1e250041bc1e651cce13eff7f2b728.tar.gz merchant-7e7af4255d1e250041bc1e651cce13eff7f2b728.zip |
Again on 424 context creation.
The 2-coins payment needs to be moved where
it is _not_ reached by the /track/transaction
CMD; otherwise it'd get cached in the DB and
no twisting of it can happen.
-rw-r--r-- | src/merchant-tools/taler-merchant-generate-payments_new.c | 80 |
1 files changed, 44 insertions, 36 deletions
diff --git a/src/merchant-tools/taler-merchant-generate-payments_new.c b/src/merchant-tools/taler-merchant-generate-payments_new.c index 202f3c81..ca42d52d 100644 --- a/src/merchant-tools/taler-merchant-generate-payments_new.c +++ b/src/merchant-tools/taler-merchant-generate-payments_new.c | |||
@@ -204,42 +204,6 @@ run (void *cls, | |||
204 | "USD:4.99", | 204 | "USD:4.99", |
205 | "USD:0.01"), | 205 | "USD:0.01"), |
206 | 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 | |||
243 | TALER_TESTING_cmd_rewind_ip | 207 | TALER_TESTING_cmd_rewind_ip |
244 | ("rewind-payments", | 208 | ("rewind-payments", |
245 | FIRST_INSTRUCTION, | 209 | FIRST_INSTRUCTION, |
@@ -345,6 +309,50 @@ run (void *cls, | |||
345 | "deposit-simple-3", | 309 | "deposit-simple-3", |
346 | "USD:0.01"), | 310 | "USD:0.01"), |
347 | 311 | ||
312 | /* Doing the 2-coins payment; needed to generate the | ||
313 | * "failed dependency" response error, at /track/transaction. | ||
314 | * NOTE: not used here, but done just in case a testing | ||
315 | * program would need it. And this MUST happen here, as | ||
316 | * no tracking operation happens next and so the merchant | ||
317 | * won't be able to use a cached version in its database | ||
318 | * when serving /track/..; therefore it will relate to the | ||
319 | * exchange that can be twisted by the testing logic. */ | ||
320 | TALER_TESTING_cmd_proposal | ||
321 | ("create-proposal-4&5", | ||
322 | merchant_url, | ||
323 | is->ctx, | ||
324 | MHD_HTTP_OK, | ||
325 | "{\"max_fee\":\ | ||
326 | {\"currency\":\"USD\",\ | ||
327 | \"value\":0,\ | ||
328 | \"fraction\":50000000},\ | ||
329 | \"refund_deadline\":\"\\/Date(0)\\/\",\ | ||
330 | \"pay_deadline\":\"\\/Date(99999999999)\\/\",\ | ||
331 | \"amount\":\ | ||
332 | {\"currency\":\"USD\",\ | ||
333 | \"value\":10,\ | ||
334 | \"fraction\":0},\ | ||
335 | \"summary\": \"2-coins payment\",\ | ||
336 | \"fulfillment_url\": \"https://example.com/\",\ | ||
337 | \"products\": [ {\"description\":\"2-coins payment\",\ | ||
338 | \"value\":\"{USD:10}\"} ] }", | ||
339 | NULL), | ||
340 | |||
341 | TALER_TESTING_cmd_pay ("deposit-4&5", | ||
342 | merchant_url, | ||
343 | is->ctx, | ||
344 | MHD_HTTP_OK, | ||
345 | "create-proposal-4&5", | ||
346 | "withdraw-coin-4;" \ | ||
347 | "withdraw-coin-5", | ||
348 | "EUR:10", | ||
349 | "EUR:9.98", // no sense now | ||
350 | "EUR:0.02"), // no sense now | ||
351 | |||
352 | TALER_TESTING_cmd_exec_aggregator | ||
353 | ("aggregate-2", | ||
354 | cfg_filename), | ||
355 | |||
348 | TALER_TESTING_cmd_rewind_ip | 356 | TALER_TESTING_cmd_rewind_ip |
349 | ("rewind-tracks", | 357 | ("rewind-tracks", |
350 | TRACKS_INSTRUCTION, | 358 | TRACKS_INSTRUCTION, |