UNPKG

securepay

Version:

https://www.securepay.com.au/

38 lines (37 loc) 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SecurePay = void 0; var debug_level_enum_1 = require("../enums/debug-level.enum"); var authentication_service_1 = require("../services/authentication/authentication.service"); var SecurePay = /** @class */ (function () { function SecurePay(options) { /** Variables */ this.clientId = ""; this.clientSecret = ""; this.sandbox = true; this.debugLevel = debug_level_enum_1.DebugLevel.NONE; /** Services */ this._auth = new authentication_service_1.AuthenticationService(); /** Initial Credential */ if (options.clientId && options.clientSecret) this.setCredential(options.clientId, options.clientSecret); } /** * Set / Update Credential * * @param {string} clientId * @param {string} clientSecret */ SecurePay.prototype.setCredential = function (clientId, clientSecret) { this.clientId = clientId; this.clientSecret = clientSecret; return this.clientId && this.clientSecret && this._auth.auth({ clientId: this.clientId, clientSecret: this.clientSecret, sandbox: this.sandbox, debugLevel: this.debugLevel }); }; return SecurePay; }()); exports.SecurePay = SecurePay;