-
+
+
+
- email
-
-
+
+
+
+
+ {{ errors?.phone }}
+
+
+
+
+
+
+
+
+
+ {{ errors?.email }}
+
+
-
+
-
diff --git a/server/api/bspb.ts b/server/api/bspb.ts
index 65fbdd3..099e7f9 100644
--- a/server/api/bspb.ts
+++ b/server/api/bspb.ts
@@ -1,8 +1,8 @@
import https from 'node:https'
import axios from 'axios'
-import { defineEventHandler } from 'h3'
+import { defineEventHandler, readBody } from 'h3'
-export default defineEventHandler(async () => {
+export default defineEventHandler(async (event) => {
const merchantId = process.env.BSPB_MERCHANT_ID!
const merchantPassword = process.env.BSPB_MERCHANT_PASSWORD!
const apiUrl = process.env.BSPB_API_URL!
@@ -18,18 +18,9 @@ export default defineEventHandler(async () => {
rejectUnauthorized: false,
})
- const data = {
- order: {
- typeRid: 'Purchase',
- amount: 100,
- currency: 'RUB',
- title: 'Название заказа',
- description: 'Описание заказа',
- hppRedirectUrl: 'http://localhost:3000/cart',
- },
- }
+ const orderData = await readBody(event)
- const response = await axios.post(`${apiUrl}/order`, data, {
+ const response = await axios.post(`${apiUrl}/order`, orderData, {
httpsAgent: agent,
headers: {
'Content-Type': 'application/json',
diff --git a/yarn.lock b/yarn.lock
index 688462b..1deca0c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2500,6 +2500,15 @@
hookable "^5.5.3"
unhead "2.0.19"
+"@vee-validate/nuxt@^4.15.1":
+ version "4.15.1"
+ resolved "https://registry.yarnpkg.com/@vee-validate/nuxt/-/nuxt-4.15.1.tgz#4062be82b364f5b16fa1be31aa3be59c47012ba7"
+ integrity sha512-vy+BYUmwy7d01js8jg3qApyrE8/nJHbHvPZNYZSe+hTQEblNqyVt+MnD1incyxMCcivED8FX5w4rjxdoUn7iMQ==
+ dependencies:
+ "@nuxt/kit" "^3.13.2"
+ local-pkg "^0.5.0"
+ vee-validate "4.15.1"
+
"@vercel/nft@^0.30.2":
version "0.30.3"
resolved "https://registry.yarnpkg.com/@vercel/nft/-/nft-0.30.3.tgz#ab09a7f22ec7b354fcbe2d79f3d8c0c8adfbcc89"
@@ -2645,6 +2654,13 @@
resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz#cbe97fe0162b365edc1dba80e173f90492535343"
integrity sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==
+"@vue/devtools-api@^7.5.2":
+ version "7.7.7"
+ resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-7.7.7.tgz#5ef5f55f60396220725a273548c0d7ee983d5d34"
+ integrity sha512-lwOnNBH2e7x1fIIbVT7yF5D+YWhqELm55/4ZKf45R9T8r9dE2AIOy8HKjfqzGsoTHFbWbr337O4E0A0QADnjBg==
+ dependencies:
+ "@vue/devtools-kit" "^7.7.7"
+
"@vue/devtools-core@^7.7.7":
version "7.7.7"
resolved "https://registry.yarnpkg.com/@vue/devtools-core/-/devtools-core-7.7.7.tgz#9885e2ecb7b462cca8e629d9cff0ab00bfd30d63"
@@ -5482,6 +5498,14 @@ listhen@^1.5.6, listhen@^1.9.0:
untun "^0.1.3"
uqr "^0.1.2"
+local-pkg@^0.5.0:
+ version "0.5.1"
+ resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.5.1.tgz#69658638d2a95287534d4c2fff757980100dbb6d"
+ integrity sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==
+ dependencies:
+ mlly "^1.7.3"
+ pkg-types "^1.2.1"
+
local-pkg@^1.0.0, local-pkg@^1.1.1, local-pkg@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-1.1.2.tgz#c03d208787126445303f8161619dc701afa4abb5"
@@ -6139,7 +6163,7 @@ mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113"
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
-mlly@^1.3.0, mlly@^1.7.1, mlly@^1.7.2, mlly@^1.7.4, mlly@^1.8.0:
+mlly@^1.3.0, mlly@^1.7.1, mlly@^1.7.2, mlly@^1.7.3, mlly@^1.7.4, mlly@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.8.0.tgz#e074612b938af8eba1eaf43299cbc89cb72d824e"
integrity sha512-l8D9ODSRWLe2KHJSifWGwBqpTZXIXTeo8mlKjY+E2HAakaTeNpqAyBZ8GSqLzHgw4XmHmC8whvpjJNMbFZN7/g==
@@ -8197,6 +8221,11 @@ type-check@^0.4.0, type-check@~0.4.0:
dependencies:
prelude-ls "^1.2.1"
+type-fest@^4.8.3:
+ version "4.41.0"
+ resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58"
+ integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==
+
type-fest@^5.0.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-5.1.0.tgz#30ba6dc2acde4f73732417031f8ac19a0afcb5b7"
@@ -8516,6 +8545,14 @@ vaul-vue@0.4.1:
reka-ui "^2.0.0"
vue "^3.4.5"
+vee-validate@4.15.1:
+ version "4.15.1"
+ resolved "https://registry.yarnpkg.com/vee-validate/-/vee-validate-4.15.1.tgz#66e787e88916baa05f42e53bc0848e0878d50f91"
+ integrity sha512-DkFsiTwEKau8VIxyZBGdO6tOudD+QoUBPuHj3e6QFqmbfCRj1ArmYWue9lEp6jLSWBIw4XPlDLjFIZNLdRAMSg==
+ dependencies:
+ "@vue/devtools-api" "^7.5.2"
+ type-fest "^4.8.3"
+
vite-dev-rpc@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/vite-dev-rpc/-/vite-dev-rpc-1.1.0.tgz#a54be63cc4dbb127bce1360e4b12d9038087c204"