a-wire-gateway-api.tex (2525B)
1 \subsubsection{Wire-Gateway API} 2 \label{sec-implementation-wire-gateway-api} 3 4 The Wire-Gateway API \cite{taler-wire-gateway-api} delivers the transaction history to the exchange which will create reserves for the specific public keys and therefore allow the customers to finally withdraw the digital cash using their wallet. Additionally it allows the Exchange to trigger transfers and keep track of executed transfers. 5 6 Following endpoints are implemented by the wire gateway API implementation: 7 8 \begin{itemize} 9 \item GET /config 10 \item GET /history/incoming 11 \item POST /transfer 12 \item GET /history/outgoing 13 \end{itemize} 14 15 % \begin{figure}[h] 16 % \centering 17 % \includegraphics[width=0.7\textwidth]{pictures/diagrams/wire-gateway-api.png} 18 % \caption{Wire-Gateway API endpoints} 19 % \label{fig-diagram-wire-gateway-api-sequence} 20 % \end{figure} 21 22 \textbf{Configuration (/config)} 23 24 The wire gateway configuration is used by the Exchange wirewatch component to check the compatibility of the component. This includes the check of the supported currency and the version. 25 26 \textbf{Incoming transactions (/history/incoming)} 27 28 The C2EC component needs to return incoming transactions by providers through the \textit{/history/incoming} endpoint. This will eventually create the reserve at the Exchange and therefore allow the customer to withdraw the digital cash using their Wallet. The 29 30 \textbf{Transfers (/transfer)} 31 32 The specification \cite{taler-wire-gateway-api} requires the implementor of the API to keep track of incoming transfer requests. In order to guarantee the idempotence of the API, the implementation keeps track of all transfers in the database table \textit{transfers}. It stores the transfer data in the database. If a request with the same UID is sent to the transfer-API, first it is checked that the incoming request is exactly the same as the previous one by comparing the request to the values stored in the database. Only if the values are the same, the transfer request is processed further. Otherwise the API responds with a conflict response. The refund will always make a full refund. Partial refunds are not supported in the current implementation. 33 34 \textbf{Outgoing transactions (/history/outgoing)} 35 36 The \textit{/history/outgoing} endpoint works in the same fashion as the \textit{/history/incoming} endpoint. But it will not return a list of confirmed withdrawals, but rather the list of successfully executed transfers registered using the \textit{/transfer} endpoint.