diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-08-13 03:50:15 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-08-13 03:50:15 -0400 |
commit | 452f20d71ef5c659c269389a4156f462521737ed (patch) | |
tree | 2c41694f98e59713bcfd405cc1a1777ef397f505 /src/testing/testing_api_cmd_merchant_get_order.c | |
parent | 7815ccb8c2cc74d44eb214e0c1f14833c5638b45 (diff) | |
download | merchant-452f20d71ef5c659c269389a4156f462521737ed.tar.gz merchant-452f20d71ef5c659c269389a4156f462521737ed.tar.bz2 merchant-452f20d71ef5c659c269389a4156f462521737ed.zip |
test for increasing refunds multiple times
Diffstat (limited to 'src/testing/testing_api_cmd_merchant_get_order.c')
-rw-r--r-- | src/testing/testing_api_cmd_merchant_get_order.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/testing/testing_api_cmd_merchant_get_order.c b/src/testing/testing_api_cmd_merchant_get_order.c index 1fed93a6..87afb01c 100644 --- a/src/testing/testing_api_cmd_merchant_get_order.c +++ b/src/testing/testing_api_cmd_merchant_get_order.c @@ -172,6 +172,7 @@ merchant_get_order_cb ( if (gos->paid) { const struct TALER_TESTING_Command *order_cmd; + struct TALER_Amount refunded_total; order_cmd = TALER_TESTING_interpreter_lookup_command ( gos->is, @@ -371,6 +372,10 @@ merchant_get_order_cb ( TALER_TESTING_interpreter_fail (gos->is); return; } + if (0 < gos->refunds_length) + GNUNET_assert (GNUNET_OK == + TALER_amount_get_zero (osr->details.paid.refund_amount.currency, + &refunded_total)); for (unsigned int i = 0; i < gos->refunds_length; ++i) { const struct TALER_TESTING_Command *refund_cmd; @@ -397,11 +402,14 @@ merchant_get_order_cb ( GNUNET_assert (GNUNET_OK == TALER_string_to_amount (expected_amount_str, &expected_amount)); + GNUNET_assert (0 <= TALER_amount_add (&refunded_total, + &refunded_total, + amount_found)); if ((GNUNET_OK != TALER_amount_cmp_currency (&expected_amount, - amount_found)) || + &refunded_total)) || (0 != TALER_amount_cmp (&expected_amount, - amount_found))) + &refunded_total))) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Refund amounts do not match\n"); |