{"size": 3624, "ext": "js", "max_stars_repo_path": "node_modules/transbank-sdk/dist/es6/transbank/webpay/oneclick/index.js", "max_stars_repo_name": "MemosaurioRex/webpay_plus", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "node_modules/transbank-sdk/dist/es6/transbank/webpay/oneclick/index.js", "max_issues_repo_name": "MemosaurioRex/webpay_plus", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "node_modules/transbank-sdk/dist/es6/transbank/webpay/oneclick/index.js", "max_forks_repo_name": "MemosaurioRex/webpay_plus", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 42.6352941176, "max_line_length": 104, "alphanum_fraction": 0.7102649007}
import Options from '../../common/options';
import Environment from '../common/environment';
import _MallDeferredInscription from './mall_deferred_inscription';
import _MallDeferredTransaction from './mall_deferred_transaction';
import _MallInscription from './mall_inscription';
import _MallTransaction from './mall_transaction';
var Oneclick;
(function (Oneclick) {
    const DEFAULT_API_KEY = '579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C';
    /**
     * Contains methods used to start, finish and delete Inscriptions.
     */
    Oneclick.MallInscription = _MallInscription;
    /**
     * Contains methods used to authorize, commit, refund and capture mall Transactions.
     */
    Oneclick.MallTransaction = _MallTransaction;
    /**
     * Contains methods used to start, finish and delete Inscriptions.
     * This is freely interchangeable with {@link MallInscription}
     */
    Oneclick.MallDeferredInscription = _MallDeferredInscription;
    /**
     * Contains methods used to authorize, commit, refund and capture deferred mall Transactions.
     */
    Oneclick.MallDeferredTransaction = _MallDeferredTransaction;
    /**
     * Used to authenticate against the API, currently configured Commerce Code.
     */
    Oneclick.commerceCode = '597055555541';
    /**
     * Used to authenticate against the API, currently configured Api Key.
     */
    Oneclick.apiKey = DEFAULT_API_KEY;
    /**
     * Used to select the corresponding API URL, currently configured Environment
     */
    Oneclick.environment = Environment.Integration;
    /**
     * @returns Currently configured Commerce Code and Api Key
     */
    Oneclick.getDefaultOptions = () => {
        return new Options(Oneclick.commerceCode, Oneclick.apiKey, Oneclick.environment);
    };
    /**
     * This methods configures the module to point to the Production Environment with the given params.
     * @param _commerceCode Commerce Code given by Transbank when contracting the product
     * @param _apiKey Api Key given by Transbank when you sucessfuly validate your integration
     */
    Oneclick.configureForProduction = (_commerceCode, _apiKey) => {
        Oneclick.commerceCode = _commerceCode;
        Oneclick.apiKey = _apiKey;
        Oneclick.environment = Environment.Production;
    };
    /**
     * This methods configures the module to point to the Integration Environment with the given params.
     * You can check use the credentials provided in the official docs.
     * https://transbankdevelopers.cl/documentacion/como_empezar#codigos-de-comercio
     * @param _commerceCode Commerce Code given by Transbank.
     * @param _apiKey Api Key given by Transbank.
     */
    Oneclick.configureForIntegration = (_commerceCode, _apiKey) => {
        Oneclick.commerceCode = _commerceCode;
        Oneclick.apiKey = _apiKey;
        Oneclick.environment = Environment.Integration;
    };
    /**
     * This method configures the module to use Oneclick Mall in the Integration environment.
     */
    Oneclick.configureOneclickMallForTesting = () => {
        Oneclick.commerceCode = '597055555541';
        Oneclick.apiKey = DEFAULT_API_KEY;
        Oneclick.environment = Environment.Integration;
    };
    /**
     * This method configures the module to use Oneclick Mall deferred in the Integration environment.
     */
    Oneclick.configureOneclickMallDeferredForTesting = () => {
        Oneclick.commerceCode = '597055555547';
        Oneclick.apiKey = DEFAULT_API_KEY;
        Oneclick.environment = Environment.Integration;
    };
})(Oneclick || (Oneclick = {}));
export default Oneclick;
