UNPKG

transbank-sdk

Version:
24 lines (23 loc) 1.01 kB
/** * Class containing needed authenticaction and configuration to interact with the API. * Environment correspond to the environment to use, it can be Integration or Production, each has * a unique URL. */ class Options { /** * Create an instance of Options * @param commerceCode unique commerce identifier provided by Transbank * @param apiKey the secret used to authenticate against the API, it must be kept safe at all times. * @param environment Environment correspond to the environment to use, it can be Integration or * Production, each has a unique URL. * @param timeout Timeout for requests in milliseconds */ constructor(commerceCode, apiKey, environment, timeout) { const defaultTimeout = 1000 * 60 * 10; this.commerceCode = commerceCode; this.apiKey = apiKey; this.environment = environment; this.timeout = timeout !== null && timeout !== void 0 ? timeout : defaultTimeout; } } export default Options;