diff --git a/payment.html b/payment.html deleted file mode 100644 index 184d9bb..0000000 --- a/payment.html +++ /dev/null @@ -1,291 +0,0 @@ - - - - - Оплата через СБП - - - - - - - -
-
- -
- -

Оплата через СБП

-

Система быстрых платежей

-
- -
- -
- -
- - -
- -
- -
- 🇷🇺 - RUB - Российский рубль -
- -
- - -
- - - -
- - - -
-
- - - - - diff --git a/proxy.conf.json b/proxy.conf.json index 83d7baa..f56c3f7 100644 --- a/proxy.conf.json +++ b/proxy.conf.json @@ -1,11 +1,4 @@ { - "/proxy/legacy-qr": { - "target": "https://qr.vitanova.network:567", - "secure": false, - "changeOrigin": true, - "pathRewrite": { "^/proxy/legacy-qr": "" }, - "logLevel": "debug" - }, "/proxy/fastcheck": { "target": "https://api.fastcheck.store", "secure": true, diff --git a/src/app/pages/fastcheck-page/fastcheck-page.html b/src/app/pages/fastcheck-page/fastcheck-page.html index ede6d17..c1c20fa 100644 --- a/src/app/pages/fastcheck-page/fastcheck-page.html +++ b/src/app/pages/fastcheck-page/fastcheck-page.html @@ -57,16 +57,6 @@
- -
- - - - diff --git a/src/app/pages/legacy-pay-page/legacy-pay-page.scss b/src/app/pages/legacy-pay-page/legacy-pay-page.scss deleted file mode 100644 index 7af3f29..0000000 --- a/src/app/pages/legacy-pay-page/legacy-pay-page.scss +++ /dev/null @@ -1,81 +0,0 @@ -@use './../../../shared' as *; - -.sbp-logo { - display: inline-flex; - align-items: center; - justify-content: center; - background: rgba(255, 255, 255, 0.15); - backdrop-filter: blur(8px); - border-radius: 16px; - padding: 12px 20px; - border: 1px solid rgba(255, 255, 255, 0.25); - margin-bottom: 14px; - - img { - height: 40px; - display: block; - - @media (max-width: 480px) { - height: 34px; - } - } -} - -.currency-badge { - display: flex; - align-items: center; - gap: 10px; - background: #f1f5f9; - border-radius: 12px; - padding: 12px 16px; - margin-bottom: 18px; - - &__flag { font-size: 22px; line-height: 1; } - &__code { font-size: 15px; font-weight: 700; color: #0f172a; } - &__name { font-size: 13px; color: #64748b; margin-left: auto; } -} - -.qr-pay { - display: flex; - flex-direction: column; - align-items: center; - gap: 12px; - margin-bottom: 20px; - - img { - border-radius: 12px; - border: 1px solid #e2e8f0; - display: block; - } - - &__hint { - font-size: 13px; - color: #64748b; - text-align: center; - margin: 0; - } -} - -.note-input { - width: 100%; - border: 2px solid #e2e8f0; - border-radius: 14px; - background: #f8fafc; - padding: 14px 16px; - font-size: 15px; - font-weight: 500; - color: #0f172a; - font-family: inherit; - resize: vertical; - outline: none; - transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; - line-height: 1.5; - - &::placeholder { color: #cbd5e1; font-weight: 400; } - - &:focus { - border-color: #2563eb; - box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); - background: #fff; - } -} diff --git a/src/app/pages/legacy-pay-page/legacy-pay-page.ts b/src/app/pages/legacy-pay-page/legacy-pay-page.ts deleted file mode 100644 index f8530e3..0000000 --- a/src/app/pages/legacy-pay-page/legacy-pay-page.ts +++ /dev/null @@ -1,107 +0,0 @@ -import { Component, computed, inject, isDevMode, signal } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { ActivatedRoute } from '@angular/router'; -import { HttpClient } from '@angular/common/http'; -import { TranslatePipe } from '../../translate/translate.pipe'; -import { TranslationService } from '../../translate/translation.service'; - -interface LegacyPayResponse { - nspkurl?: string; -} - -/** - * Legacy SBP merchant payment flow. - * Activated when the root URL has `?id=`. - * Mirrors public/payment.html behaviour: - * POST https://qr.vitanova.network:567/qr - * { payment, amount, currency, id, note } -> { payload: '' } - * then window.location.href = payload. - */ -@Component({ - selector: 'app-legacy-pay-page', - imports: [FormsModule, TranslatePipe], - templateUrl: './legacy-pay-page.html', - styleUrl: './legacy-pay-page.scss' -}) -export class LegacyPayPage { - private http = inject(HttpClient); - private route = inject(ActivatedRoute); - private i18n = inject(TranslationService); - - private t(key: string): string { return this.i18n.translate(key); } - - private readonly LEGACY_API = isDevMode() - ? '/proxy/legacy-qr/qr' - : 'https://qr.vitanova.network:567/qr'; - - amount = signal(null); - note = signal(''); - error = signal(''); - loading = signal(false); - nspkUrl = signal(''); - - get isMobile(): boolean { - return window.innerWidth < 768; - } - - paymentId = signal(''); - - canPay = computed(() => { - const a = this.amount(); - return !!this.paymentId() && a !== null && a > 0 && !this.loading(); - }); - - constructor() { - const id = this.route.snapshot.queryParamMap.get('id') ?? ''; - this.paymentId.set(id); - } - - onAmountChange(value: number | null): void { - this.amount.set(value); - if (this.error()) this.error.set(''); - } - - onNoteChange(value: string): void { - this.note.set(value); - } - - pay(): void { - if (!this.canPay()) { - if (!this.paymentId()) { - this.error.set(this.t('errors.not_found')); - } else { - this.error.set(this.t('errors.invalid_amount')); - } - return; - } - this.error.set(''); - this.loading.set(true); - - const body = { - qrtype: 'QRDynamic', - amount: this.amount(), - currency: 'RUB', - partnerqrID: this.paymentId(), - qrDescription: this.note().trim() - }; - - this.http.post(this.LEGACY_API, body).subscribe({ - next: (res) => { - this.loading.set(false); - if (res?.nspkurl) { - if (this.isMobile) { - window.location.href = res.nspkurl; - } else { - this.nspkUrl.set(res.nspkurl); - } - } else { - this.error.set(this.t('errors.payment_failed')); - } - }, - error: () => { - this.loading.set(false); - this.error.set(this.t('errors.lookup_failed')); - } - }); - } -}