summaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-07-27 16:00:32 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-07-27 16:00:32 -0400
commitd13adea86b74accb650cd9102698d8e2ddbf3849 (patch)
tree7f0dae30cf4ac52a44591fff99ced0fe4f309562 /src/testing
parent2809a8643ba5a9f1c2c8b85963a03814790159c7 (diff)
downloadmerchant-d13adea86b74accb650cd9102698d8e2ddbf3849.tar.gz
merchant-d13adea86b74accb650cd9102698d8e2ddbf3849.tar.bz2
merchant-d13adea86b74accb650cd9102698d8e2ddbf3849.zip
add amount, summary, and refundable to GET /private/orders
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/testing_api_cmd_get_orders.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/testing/testing_api_cmd_get_orders.c b/src/testing/testing_api_cmd_get_orders.c
index db3e20a2..2b9c762e 100644
--- a/src/testing/testing_api_cmd_get_orders.c
+++ b/src/testing/testing_api_cmd_get_orders.c
@@ -130,6 +130,51 @@ get_orders_cb (void *cls,
return;
}
}
+ {
+ const json_t *contract_terms;
+ struct TALER_Amount amount;
+ const char *summary;
+ struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_string ("summary",
+ &summary),
+ TALER_JSON_spec_amount ("amount",
+ &amount),
+ GNUNET_JSON_spec_end ()
+ };
+
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_contract_terms (order_cmd,
+ 0,
+ &contract_terms))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Could not fetch order contract terms\n");
+ TALER_TESTING_interpreter_fail (gos->is);
+ return;
+ }
+ if (GNUNET_OK !=
+ GNUNET_JSON_parse (contract_terms,
+ spec,
+ NULL, NULL))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Could not parse order contract terms\n");
+ TALER_TESTING_interpreter_fail (gos->is);
+ return;
+ }
+ if ((0 != strcmp (summary,
+ orders[i].summary)) ||
+ (GNUNET_OK != TALER_amount_cmp_currency (&amount,
+ &orders[i].amount)) ||
+ (0 != TALER_amount_cmp (&amount,
+ &orders[i].amount)))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Order summary and/or amount does not match\n");
+ TALER_TESTING_interpreter_fail (gos->is);
+ return;
+ }
+ }
}
break;
default: