From cb55c1a3af9f56a6da38e5589e72df0b70d355b1 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 2 Apr 2018 14:24:45 +0200 Subject: Changing configuration structure to enable multiple accounts. This change enables using multiple wire plugins at the same time. Also, we now distinguish between the wire plugin (i.e. EBICS or taler_bank) and the wire method (i.e. SEPA or x-taler-bank) that the wire plugin is implementing. The "taler-bank" wire method was renamed from "test" to "x-taler-bank". This also changes the format of the /wire response of the exchange, as we now need to return multiple accounts. Note that wire fees are specified per wire method, not per wire account. taler-exchange-keyup now automatically signs all of the /wire responses in the location specified by the configuration. Account identification in wire plugins was changed to use payto://-URLs instead of method-specific JSON fields. Signing and validation of /wire responses was moved from each wire plugin to a generic validation method in libtalerutil (crypto) or libtalerjson (for JSON-formatted inputs). Convenience methods were added to generate JSON for wire accounts (salting, signing). Various section and option names were adjusted to streamline the configuration and make it more consistent overall. Documentation was updated as well. --- src/bank-lib/testing_api_cmd_history.c | 47 +++++++++++++--------------------- 1 file changed, 18 insertions(+), 29 deletions(-) (limited to 'src/bank-lib/testing_api_cmd_history.c') diff --git a/src/bank-lib/testing_api_cmd_history.c b/src/bank-lib/testing_api_cmd_history.c index 30090bf8c..e94009fb3 100644 --- a/src/bank-lib/testing_api_cmd_history.c +++ b/src/bank-lib/testing_api_cmd_history.c @@ -99,6 +99,7 @@ history_traits (void *cls, return GNUNET_SYSERR; } + /** * Test if the /admin/add/incoming transaction at offset @a off * has been /rejected. @@ -115,7 +116,8 @@ test_cancelled (struct TALER_TESTING_Interpreter *is, const struct TALER_TESTING_Command *current_cmd; current_cmd = &is->commands[off]; - TALER_LOG_INFO ("Is `%s' rejected?\n", current_cmd->label); + TALER_LOG_INFO ("Is `%s' rejected?\n", + current_cmd->label); for (unsigned int i=0;iip;i++) { const struct TALER_TESTING_Command *c = &is->commands[i]; @@ -140,6 +142,7 @@ test_cancelled (struct TALER_TESTING_Interpreter *is, return GNUNET_NO; } + /** * Free history @a h of length @a h_len. * @@ -153,11 +156,12 @@ free_history (struct History *h, for (uint64_t off = 0;offbank_url, - "account_number", - (json_int_t) *debit_account_no); - GNUNET_assert (NULL != h[total].details.account_details); + GNUNET_asprintf (&h[total].details.account_url, + "payto://x-taler-bank/%s/%llu", + hs->bank_url, + (unsigned long long) *debit_account_no); } if ( (0 != (hs->direction & TALER_BANK_DIRECTION_DEBIT)) && (hs->account_no == *debit_account_no)) @@ -425,15 +419,10 @@ build_history (struct TALER_TESTING_Interpreter *is, h[total].direction = TALER_BANK_DIRECTION_DEBIT; if (GNUNET_YES == cancelled) h[total].direction |= TALER_BANK_DIRECTION_CANCEL; - h[total].details.account_details - = json_pack ("{s:s, s:s, s:I}", - "type", - "test", - "bank_url", - hs->bank_url, - "account_number", - (json_int_t) *credit_account_no); - GNUNET_assert (NULL != h[total].details.account_details); + GNUNET_asprintf (&h[total].details.account_url, + "payto://x-taler-bank/%s/%llu", + hs->bank_url, + (unsigned long long) *credit_account_no); } if ( ( (0 != (hs->direction & TALER_BANK_DIRECTION_CREDIT)) && (hs->account_no == *credit_account_no)) || @@ -533,8 +522,8 @@ check_result (struct TALER_TESTING_Interpreter *is, details->wire_transfer_subject)) || (0 != TALER_amount_cmp (&h[off].details.amount, &details->amount)) || - (1 != json_equal (h[off].details.account_details, - details->account_details)) ) + (0 != strcasecmp (h[off].details.account_url, + details->account_url)) ) { GNUNET_break (0); print_expected (h, total, off); -- cgit v1.2.3