taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

get-exchange-tos.rst (1883B)


      1 .. ts:op:: getExchangeTos
      2 
      3   Get the current terms of service of an exchange.
      4 
      5   **Request:**
      6 
      7   The request arguments must be a `GetExchangeTosRequest` object.
      8 
      9   **Response:**
     10 
     11   On success, the result is a `GetExchangeTosResult` object.
     12 
     13   **Side effects:**
     14 
     15   Fetches the current terms of service from the exchange over the
     16   network and stores the new ETag in the exchange record.
     17 
     18   **Expected errors:**
     19 
     20   The caller can handle the following errors inline:
     21   ``WALLET_EXCHANGE_ENTRY_NOT_FOUND``.
     22 
     23   **Details:**
     24 
     25   The wallet downloads the terms of service from the exchange, using
     26   ``acceptedFormat`` and ``acceptLanguage`` for content negotiation,
     27   and updates its stored current ToS version tag.  If the exchange
     28   does not provide terms of service, ``tosStatus`` is
     29   ``"missing-tos"`` and the content fields carry placeholder values.
     30 
     31 .. ts:def:: GetExchangeTosRequest
     32 
     33   interface GetExchangeTosRequest {
     34     exchangeBaseUrl: string;
     35 
     36     // Acceptable content types for the ToS text, used for content
     37     // negotiation with the exchange.
     38     acceptedFormat?: string[];
     39 
     40     // Preferred language for the ToS text.
     41     acceptLanguage?: string;
     42 
     43     // Correlates progress notifications and allows cancellation.
     44     progressToken?: string;
     45   }
     46 
     47 .. ts:def:: GetExchangeTosResult
     48 
     49   interface GetExchangeTosResult {
     50     // Markdown version of the current ToS.
     51     content: string;
     52 
     53     // Version tag of the current ToS.
     54     currentEtag: string;
     55 
     56     // Version tag of the last ToS that the user has accepted, if any.
     57     acceptedEtag: string | undefined;
     58 
     59     // Accepted content type
     60     contentType: string;
     61 
     62     // Language of the returned content.  If missing, language is
     63     // unknown.
     64     contentLanguage: string | undefined;
     65 
     66     // Available languages as advertised by the exchange.
     67     tosAvailableLanguages: string[];
     68 
     69     tosStatus: ExchangeTosStatus;
     70   }