taler-docs

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

get-config.rst (7224B)


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