taler-docs

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

get-config.rst (7048B)


      1 .. http:get:: /config
      2 
      3   Return the protocol version and currency supported by this merchant backend.
      4 
      5   **Response:**
      6 
      7   :http:statuscode:`200 OK`:
      8     The body is a `MerchantVersionResponse`.
      9   :http:statuscode:`500 Internal Server Error`:
     10     The server experienced an internal failure.
     11 
     12   **Details:**
     13 
     14   .. ts:def:: MerchantVersionResponse
     15 
     16     interface MerchantVersionResponse {
     17       // libtool-style representation of the Merchant protocol version, see
     18       // https://www.gnu.org/software/libtool/manual/html_node/Versioning.html#Versioning
     19       // The format is "current:revision:age".
     20       version: string;
     21 
     22       // Name of the protocol.
     23       name: "taler-merchant";
     24 
     25       // URN of the implementation (needed to interpret 'revision' in version).
     26       // @since **v8**, may become mandatory in the future.
     27       implementation?: string;
     28 
     29       // Default (!) currency supported by this backend.
     30       // This is the currency that the backend should
     31       // suggest by default to the user when entering
     32       // amounts. See ``currencies`` for a list of
     33       // supported currencies and how to render them.
     34       currency: string;
     35 
     36       // Which Persona should be used by default by new clients in the SPA.
     37       // Can be changed locally per browers under "Personalization".
     38       // Possible values include "expert", "offline-vending-machine",
     39       // "point-of-sale", "digital-publishing", "e-commerce" and "developer".
     40       // @since **v23**.
     41       default_persona: string;
     42 
     43       // How services should render currencies supported
     44       // by this backend.  Maps
     45       // currency codes (e.g. "EUR" or "KUDOS") to
     46       // the respective currency specification.
     47       // All currencies in this map are supported by
     48       // the backend.  Note that the actual currency
     49       // specifications are a *hint* for applications
     50       // that would like *advice* on how to render amounts.
     51       // Applications *may* ignore the currency specification
     52       // if they know how to render currencies that they are
     53       // used with.
     54       currencies: { currency : CurrencySpecification};
     55 
     56       // Maps available report generator configuration section names
     57       // to descriptions of the respective report generator.
     58       // Since **v25**.
     59       report_generators: { section_name : string};
     60 
     61       // Posix regular expression for allowed phone numbers;
     62       // applies when creating or patching an instance.
     63       // Optional, can be NULL for no restrictions.
     64       // Since **v26**.
     65       phone_regex?: string;
     66 
     67       // Array of exchanges trusted by the merchant.
     68       // @since **v6**.
     69       exchanges: ExchangeConfigInfo[];
     70 
     71       // Set when the merchant supports
     72       // self-provisioning instances.
     73       // Since protocol **v21**
     74       have_self_provisioning: boolean;
     75 
     76       // True if this merchant backend supports the Donau
     77       // extension and can thus issue donation receipts.
     78       // Should primarily be used to control the SPA's CRUD
     79       // functionality for Donau.
     80       // @since **v21**
     81       have_donau: boolean;
     82 
     83       // Tan channels that are required
     84       // to be confirmed for an instance to
     85       // be useable.
     86       // @since **v21**
     87       mandatory_tan_channels?: TanChannel[];
     88 
     89       // Space-separated list of enabled payment target types.
     90       // Useful if the SPA should not show allow adding other
     91       // types of bank accounts. "*" is used to represent no
     92       // restriction.
     93       // @since **v22**
     94       payment_target_types: string;
     95 
     96       // Regular expression representing further restrictions
     97       // on allowed payment targets.  Any "payto://"-URI supplied
     98       // for a bank account must match the given regular expression.
     99       // For example, "payto://iban/CH.*" would restrict the system
    100       // to only Swiss bank accounts.
    101       // Optional, no restrictions are imposed if the field is
    102       // absent.
    103       // @since **v22**
    104       // CAUTION: Likely to be removed/deprecated,
    105       // as we'll want an array of restrictions with the
    106       // same format as the exchange uses, as this allows
    107       // proper i18n and spec/code reuse.
    108       payment_target_regex? string;
    109 
    110       // Default payment delay for new instances.
    111       // This is the default to use for new instances, see the instance value for
    112       // the instance-specific default.
    113       // A value of "forever" is not allowed.
    114       // @since **v22**
    115       default_pay_delay: RelativeTime;
    116 
    117       // If the frontend does NOT specify a refund deadline, how long should
    118       // refunds be allowed by default?
    119       // This is the default to use for new instances, see the instance value for
    120       // the instance-specific default.
    121       // A value of "forever" is not allowed.
    122       // @since **v22**
    123       default_refund_delay: RelativeTime;
    124 
    125       // Default wire transfer delay for new instances.
    126       // This is the default to use for new instances, see the instance value for
    127       // the instance-specific default.
    128       // A value of "forever" is not allowed.
    129       // @since **v22**
    130       default_wire_transfer_delay: RelativeTime;
    131 
    132       // Default interval to which wire deadlines computed by
    133       // adding the wire_transfer_delay on top of the refund
    134       // deadline should be rounded up to.
    135       // @since **v23**
    136       default_wire_transfer_rounding_interval: RoundingInterval;
    137 
    138       // General object of SPA options from the
    139       // ``GLOBAL_SPA_CONFIG_DATA`` configuration option.
    140       // @since **v28**.
    141       spa_options?: SpaConfigOptions;
    142     }
    143 
    144   .. ts:def:: TanChannel
    145 
    146     enum TanChannel {
    147       SMS = "sms",
    148       EMAIL = "email"
    149     }
    150 
    151   .. ts:def:: RoundingInterval
    152 
    153     enum RoundingInterval {
    154       NONE = "NONE",
    155       SECOND = "SECOND",
    156       MINUTE = "MINUTE",
    157       HOUR = "HOUR",
    158       DAY = "DAY",
    159       WEEK = "WEEK",
    160       MONTH = "MONTH",
    161       QUARTER = "QUARTER",
    162       YEAR = "YEAR"
    163     }
    164 
    165   .. ts:def:: ExchangeConfigInfo
    166 
    167     interface ExchangeConfigInfo {
    168 
    169       // Base URL of the exchange REST API.
    170       base_url: string;
    171 
    172       // Currency for which the merchant is configured
    173       // to trust the exchange.
    174       // May not be the one the exchange actually uses,
    175       // but is the only one we would trust this exchange for.
    176       currency: string;
    177 
    178       // Offline master public key of the exchange. The
    179       // ``/keys`` data must be signed with this public
    180       // key for us to trust it.
    181       master_pub: EddsaPublicKey;
    182     }
    183 
    184   .. ts:def:: SpaConfigOptions
    185 
    186     // Note that this object could contain many more fields,
    187     // depending on the SPA. We describe here only some of the
    188     // canonical fields that are supported by the default SPA.
    189     interface SpaConfigOptions {
    190 
    191       // How to contact the operator.
    192       contact_email?: string;
    193 
    194       // How to contact the operator.
    195       contact_phone?: string;
    196 
    197       // Where to find support.
    198       support_url?: string;
    199 
    200       // Legal address of the operator.
    201       address?: Location;
    202 
    203       // Legal tax information about the operator.
    204       tax_info?: string;
    205 
    206     }