commit 870ca3f8ec04d1d4c5be3a25bd72c9ee6bc5e3d5
parent 5a8bf79270869dd4828b00b293e4161246335795
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date: Mon, 19 Jun 2017 18:02:12 +0200
get /refund increase requested from the tests
Diffstat:
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_refund.c b/src/backend/taler-merchant-httpd_refund.c
@@ -235,12 +235,11 @@ MH_handler_refund_increase (struct TMH_RequestHandler *rh,
* Just a "200 OK" should be fine here, as the frontend has all
* the information needed to generate the right response.
*/
- return MHD_YES;
json_decref (contract_terms);
json_decref (root);
GNUNET_JSON_parse_free (spec);
- return res;
+ return MHD_YES;
}
diff --git a/src/lib/merchant_api_refund.c b/src/lib/merchant_api_refund.c
@@ -198,7 +198,7 @@ TALER_MERCHANT_refund_increase (struct GNUNET_CURL_Context *ctx,
"%s%s",
backend_uri,
"/refund");
- req = json_pack ("{s:o, s:s, s:s}",
+ req = json_pack ("{s:o, s:s, s:s, s:s}",
"refund", TALER_JSON_from_amount (refund),
"order_id", order_id,
"reason", reason,
@@ -230,7 +230,7 @@ TALER_MERCHANT_refund_increase (struct GNUNET_CURL_Context *ctx,
GNUNET_YES,
&handle_refund_increase_finished,
rio);
- return NULL;
+ return rio;
}
/**
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
@@ -2133,7 +2133,7 @@ interpreter_run (void *cls)
{
struct TALER_Amount refund_amount;
- GNUNET_assert (GNUNET_OK !=
+ GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (cmd->details.refund_increase.refund_amount,
&refund_amount));
if (NULL ==
@@ -2152,8 +2152,8 @@ interpreter_run (void *cls)
fail (is);
return;
}
- }
break;
+ }
default:
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unknown instruction %d at %u (%s)\n",
@@ -2514,7 +2514,12 @@ run (void *cls)
.details.history.start = 10,
.details.history.nrows = 10
},
-
+ { .oc = OC_REFUND_INCREASE,
+ .label = "increase-1",
+ .details.refund_increase.refund_amount = "EUR:0.1",
+ .details.refund_increase.reason = "refund test",
+ .details.refund_increase.order_id = "1"
+ },
/* end of testcase */
{ .oc = OC_END }
};