parent
c534729473
commit
adc347e86b
@ -3,15 +3,14 @@ import https from 'node:https'
|
|||||||
import path from 'node:path'
|
import path from 'node:path'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { defineEventHandler } from 'h3'
|
import { defineEventHandler } from 'h3'
|
||||||
|
import bspbKey from '@/server/cert/pgtest_key.key?raw'
|
||||||
|
import bspbCert from '@/server/cert/pgtest_cer_2025.pem?raw'
|
||||||
|
|
||||||
export default defineEventHandler(async () => {
|
export default defineEventHandler(async () => {
|
||||||
const merchantId = process.env.BSPB_MERCHANT_ID!
|
const merchantId = process.env.BSPB_MERCHANT_ID!
|
||||||
const merchantPassword = process.env.BSPB_MERCHANT_PASSWORD!
|
const merchantPassword = process.env.BSPB_MERCHANT_PASSWORD!
|
||||||
const apiUrl = process.env.BSPB_API_URL!
|
const apiUrl = process.env.BSPB_API_URL!
|
||||||
|
|
||||||
// читаем сертификаты из файлов
|
|
||||||
const bspbKey = fs.readFileSync(path.resolve('server/cert/pgtest_key.key'))
|
|
||||||
const bspbCert = fs.readFileSync(path.resolve('server/cert/pgtest_cer_2025.pem'))
|
|
||||||
|
|
||||||
const agent = new https.Agent({
|
const agent = new https.Agent({
|
||||||
key: bspbKey,
|
key: bspbKey,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user