diff options
Diffstat (limited to 'src/testing/testing_api_cmd_post_orders.c')
-rw-r--r-- | src/testing/testing_api_cmd_post_orders.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/testing/testing_api_cmd_post_orders.c b/src/testing/testing_api_cmd_post_orders.c index 3a489026..8ae0babc 100644 --- a/src/testing/testing_api_cmd_post_orders.c +++ b/src/testing/testing_api_cmd_post_orders.c @@ -111,9 +111,15 @@ struct OrdersState * The locks that the order should release. */ const char *locks; + + /** + * Should the command also CLAIM the order? + */ + bool with_claim; }; + /** * Offer internal data to other commands. * @@ -264,6 +270,11 @@ order_cb (void *cls, return; } + if (false == ps->with_claim) + { + TALER_TESTING_interpreter_next (ps->is); + return; + } if (NULL == (ps->och = TALER_MERCHANT_order_claim (ps->is->ctx, ps->merchant_url, @@ -567,6 +578,54 @@ make_order_json (const char *order_id, amount); } +/** + * Make the "proposal" command AVOIDING claiming the order. + * + * @param label command label + * @param merchant_url base URL of the merchant serving + * the proposal request. + * @param http_status expected HTTP status. + * @param order_id the name of the order to add. + * @param refund_deadline the deadline for refunds on this order. + * @param pay_deadline the deadline for payment on this order. + * @param amount the amount this order is for. + * @return the command + */ +struct TALER_TESTING_Command +TALER_TESTING_cmd_merchant_post_orders_no_claim (const char *label, + const char *merchant_url, + unsigned int http_status, + const char *order_id, + struct GNUNET_TIME_Absolute + refund_deadline, + struct GNUNET_TIME_Absolute + pay_deadline, + const char *amount) +{ + struct OrdersState *ps; + + ps = GNUNET_new (struct OrdersState); + make_order_json (order_id, + refund_deadline, + pay_deadline, + amount, + &ps->order); + ps->http_status = http_status; + ps->merchant_url = merchant_url; + ps->with_claim = false; + { + struct TALER_TESTING_Command cmd = { + .cls = ps, + .label = label, + .run = &orders_run, + .cleanup = &orders_cleanup, + .traits = &orders_traits + }; + + return cmd; + } +} + /** * Make the "proposal" command. @@ -602,6 +661,7 @@ TALER_TESTING_cmd_merchant_post_orders (const char *label, &ps->order); ps->http_status = http_status; ps->merchant_url = merchant_url; + ps->with_claim = true; { struct TALER_TESTING_Command cmd = { .cls = ps, |