From 70c2923886c66c56f5a9913b6c466692edcc5bc8 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 1 Apr 2016 16:15:44 +0200 Subject: implementing #4356, tests still failing, but main logic should now be updated --- api-exchange.rst | 67 ++++++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 36 deletions(-) (limited to 'api-exchange.rst') diff --git a/api-exchange.rst b/api-exchange.rst index 7359ef39..668bb49c 100644 --- a/api-exchange.rst +++ b/api-exchange.rst @@ -1,12 +1,15 @@ .. This file is part of GNU TALER. Copyright (C) 2014, 2015, 2016 GNUnet e.V. and INRIA + TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2.1, or (at your option) any later version. + TALER is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public License along with TALER; see the file COPYING. If not, see @@ -218,58 +221,50 @@ Obtaining wire-transfer information .. code-block:: tsref interface WireResponse { - // Names of supported methods (i.e. "sepa" or "test"). - // Payment method METHOD is available under /wire/METHOD. - methods: string[]; + // The key is a supported method (i.e. "sepa" or "test"). + // The value is a method-specific JSON object with account details + // (i.e. IBAN number, owner name, bank address, etc.). + // The value objects may also contain signatures (if applicable). + // + // A single /wire response can contain an arbitrary number of these + // string-object pairs. However, the keys must be unique. + string : Object; - // the EdDSA signature_ (binary-only) with purpose - // `TALER_SIGNATURE_EXCHANGE_PAYMENT_METHODS` signing over the hash over the - // 0-terminated strings representing the payment methods in the same order - // as given in methods. - sig: EddsaSignature; - - // public EdDSA key of the exchange that was used to generate the signature. - // Should match one of the exchange's signing keys from /keys. It is given - // explicitly as the client might otherwise be confused by clock skew as to - // which signing key was used. - pub: EddsaPublicKey; } + Possible encodings for the objects are right now the following: -.. http:get:: /wire/test - - The "test" payment method is for testing the system without using - real-world currencies or actual wire transfers. If the exchange operates - in "test" mode, this request provides a redirect to an address where - the user can initiate a fake wire transfer for testing. - - :status 200: The exchange responds with a `WireTestResponse`_ object. This request should virtually always be successful. - :status 501: This wire transfer method is not supported by this exchange. - -.. http:get:: /wire/sepa + .. _WireTestResponse: + .. _tsref-type-WireTestResponse: + .. code-block:: tsref - Provides instructions for how to transfer funds to the exchange using the SEPA - transfers. Always signed using the exchange's long-term offline master public - key. + interface WireTestResponse { + // Mandatory indicator that this is a TEST wire response. + type: "test"; - :status 200: The exchange responds with a `WireSepaResponse`_ object. This request should virtually always be successful. - :status 501: This wire transfer method is not supported by this exchange. + // Account number at the bank + account_number: Integer; + // URI of the bank + bank_uri: string; - **Details:** + } - .. _WireSepaResponse: + .. _WireSepaResponse: .. _tsref-type-WireSepaResponse: .. code-block:: tsref - interface WireSepaResponse { - // Legal name of the exchange operator who is receiving the funds + interface WireSepaResponse { + // Mandatory indicator that this is a SEPA wire response. + type: "sepa"; + + // Legal name of the owner of the account receiver_name: string; - // IBAN account number for the exchange + // IBAN account number. iban: string; - // BIC of the bank of the exchange + // BIC of the bank. bic: string; // the EdDSA signature_ (binary-only) with purpose -- cgit v1.2.3