cert/key from file

This commit is contained in:
hueso
2026-01-23 13:18:35 -03:00
parent 4695773736
commit 0432329d41

View File

@@ -11,6 +11,7 @@ import https from 'https';
import http from 'http'; import http from 'http';
import debug from 'debug'; import debug from 'debug';
import axiosDebugLog from 'axios-debug-log'; import axiosDebugLog from 'axios-debug-log';
import fs from 'fs';
// Load environment variables from .env file // Load environment variables from .env file
dotenv.config(); dotenv.config();
@@ -43,6 +44,7 @@ app.use(express.json());
class BBPay { class BBPay {
protected oauth: AxiosInstance; protected oauth: AxiosInstance;
protected cert: string; protected cert: string;
protected key: string;
protected verifySsl: string; protected verifySsl: string;
protected baseUrl: string; protected baseUrl: string;
protected params: any; protected params: any;
@@ -60,10 +62,10 @@ class BBPay {
}, },
}); });
this.cert = 'cert.pem'; this.cert = fs.readFileSync('cert.pem').toString();
this.key = 'key.pem' this.key = fs.readFileSync('key.pem').toString();
this.verifySsl = 'bb.pem'; this.verifySsl = fs.readFileSync('bb.pem').toString();
this.baseUrl = process.env.ITP_API_URL; this.baseUrl = process.env.ITP_API_URL as string;
this.params = { this.params = {
numeroConvenio: 701, numeroConvenio: 701,