thawani-nodejs
Version:
Node.js library for Thawani Payment Gateway
35 lines • 886 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Config = void 0;
class Config {
constructor(config) {
this.validateConfig(config);
this.config = {
sandbox: true,
timeout: 30000,
...config
};
}
validateConfig(config) {
if (!config.secretKey) {
throw new Error('Secret key is required');
}
if (!config.publishableKey) {
throw new Error('Publishable key is required');
}
}
get secretKey() {
return this.config.secretKey;
}
get publishableKey() {
return this.config.publishableKey;
}
get isSandbox() {
return this.config.sandbox || false;
}
get timeout() {
return this.config.timeout || 30000;
}
}
exports.Config = Config;
//# sourceMappingURL=config.js.map