From bde9651397946b143e31eb8e0c2613cc7e0705f3 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Thu, 30 Nov 2017 00:19:41 +0100 Subject: final part of reserve creation (bank side) --- api-bank.rst | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/api-bank.rst b/api-bank.rst index acce9597..4118b656 100644 --- a/api-bank.rst +++ b/api-bank.rst @@ -199,14 +199,15 @@ URI: ``git://taler.net/web-common/taler-fallback.css``. Withdrawing coins. ^^^^^^^^^^^^^^^^^ -After the user confirms the withdrawal, the bank must send back the following -information via HTTP headers: +After the user confirms the withdrawal, the bank must return a `202 Accepted` response, +along with the following HTTP headers: * ``X-Taler-Operation: create-reserve`` -* ``X-Taler-Callback-Url: http://callback.example.com/``; this URL will be automatically visited by the wallet after the user confirms the exchange. -* ``X-Taler-Wt-Types: '["test"]'`` +* ``X-Taler-Callback-Url: ``; this URL will be automatically visited by the wallet after the user confirms the exchange. +* ``X-Taler-Wt-Types: '["test"]'``; stringified JSON list of supported wire transfer types (only 'test' supported so far). * ``X-Taler-Amount: ``; stringified Taler-style JSON :ref:`amount `. * ``X-Taler-Sender-Wire: ``; stringified WireDetails_. +* ``X-Taler-Suggested-Exchange: ``; this header is optional, and ```` is the suggested exchange URL as given in the `SUGGESTED_EXCHANGE` configuration option. .. _WireDetails: .. code-block:: tsref @@ -216,3 +217,34 @@ information via HTTP headers: bank_uri: URI of the bank. account_number: bank account number of the user attempting to withdraw. } + +After the user confirms the exchange to withdraw coins from, the wallet will +visit the callback URL, in order to let the user answer some security questions +and provide all relevant data to create a reserve. + +.. note:: + Currently, the bank is in charge of creating the reserve at the chosen + exchange. In future, the exchange will "poll" its bank account and automatically + creating a reserve whenever it receives any funds, without any bank's + intervention. + +The callback URL implements the following API. + +.. http:get:: + + **Request** + + :query amount_value: integer part of the amount to be withdrawn. + :query amount_fraction: fractional part of the amount to be withdrawn. + :query amount_currency: currency of the amount to be withdrawn. + :query exchange: base URL of the exchange where the reserve is to be created. + :query reserve_pub: public key of the reserve to create. + :query wire_details: stringification of WireDetails_. + + **Response** + + Because the wallet is not supposed to take action according to this response, + the bank implementers are not required to return any particular status code here. + + For example, our demonstrator bank always redirects the browser to the user's + profile page and let them know the outcome via a informational bar. -- cgit v1.2.3