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