diff options
Diffstat (limited to 'src/testing/testing_api_cmd_refund_order.c')
-rw-r--r-- | src/testing/testing_api_cmd_refund_order.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/testing/testing_api_cmd_refund_order.c b/src/testing/testing_api_cmd_refund_order.c index fd06f887..15154149 100644 --- a/src/testing/testing_api_cmd_refund_order.c +++ b/src/testing/testing_api_cmd_refund_order.c @@ -52,7 +52,7 @@ struct RefundState /** * The amount to refund. */ - const char *refund_amount; + struct TALER_Amount refund_amount; /** * Human-readable justification for the refund. @@ -85,7 +85,7 @@ static void refund_cb (void *cls, const struct TALER_MERCHANT_HttpResponse *hr, const char *taler_refund_uri, - const struct GNUNET_HashCode *h_contract) + const struct TALER_PrivateContractHash *h_contract) { struct RefundState *ris = cls; @@ -184,17 +184,12 @@ refund_increase_run (void *cls, struct TALER_TESTING_Interpreter *is) { struct RefundState *ris = cls; - struct TALER_Amount refund_amount; ris->is = is; - if (GNUNET_OK != - TALER_string_to_amount (ris->refund_amount, - &refund_amount)) - TALER_TESTING_FAIL (is); ris->orh = TALER_MERCHANT_post_order_refund (is->ctx, ris->merchant_url, ris->order_id, - &refund_amount, + &ris->refund_amount, ris->reason, &refund_cb, ris); @@ -221,10 +216,8 @@ refund_increase_traits (void *cls, { struct RefundState *ris = cls; struct TALER_TESTING_Trait traits[] = { - TALER_TESTING_make_trait_string (0, - ris->refund_amount), - TALER_TESTING_make_trait_string (1, - ris->reason), + TALER_TESTING_make_trait_amount (&ris->refund_amount), + TALER_TESTING_make_trait_reason (&ris->reason), TALER_TESTING_trait_end () }; @@ -270,7 +263,9 @@ TALER_TESTING_cmd_merchant_order_refund (const char *label, ris = GNUNET_new (struct RefundState); ris->merchant_url = merchant_url; ris->order_id = order_id; - ris->refund_amount = refund_amount; + GNUNET_assert (GNUNET_OK == + TALER_string_to_amount (refund_amount, + &ris->refund_amount)); ris->reason = reason; ris->http_code = http_code; { |