@@ -68,7 +68,8 @@
|
|||||||
"buildTarget": "qr_vitanova:build:production"
|
"buildTarget": "qr_vitanova:build:production"
|
||||||
},
|
},
|
||||||
"development": {
|
"development": {
|
||||||
"buildTarget": "qr_vitanova:build:development"
|
"buildTarget": "qr_vitanova:build:development",
|
||||||
|
"proxyConfig": "proxy.conf.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "development"
|
"defaultConfiguration": "development"
|
||||||
|
|||||||
23
proxy.conf.json
Normal file
23
proxy.conf.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"/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,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"pathRewrite": { "^/proxy/fastcheck": "" },
|
||||||
|
"logLevel": "debug"
|
||||||
|
},
|
||||||
|
"/proxy/qr-vitanova": {
|
||||||
|
"target": "https://qr.vitanova.network",
|
||||||
|
"secure": true,
|
||||||
|
"changeOrigin": true,
|
||||||
|
"pathRewrite": { "^/proxy/qr-vitanova": "" },
|
||||||
|
"logLevel": "debug"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,21 @@
|
|||||||
/**
|
import { isDevMode } from '@angular/core';
|
||||||
|
|
||||||
|
/**
|
||||||
* Endpoint constants for the Fastcheck backend (see public/api.txt).
|
* Endpoint constants for the Fastcheck backend (see public/api.txt).
|
||||||
* Centralised so they can be swapped in one place.
|
* Centralised so they can be swapped in one place.
|
||||||
|
* In dev mode (ng serve) requests go through the Angular proxy (proxy.conf.json)
|
||||||
|
* to avoid CORS issues. In production the real URLs are used.
|
||||||
*/
|
*/
|
||||||
export const FASTCHECK_API = 'https://api.fastcheck.store';
|
export const FASTCHECK_API = isDevMode()
|
||||||
|
? '/proxy/fastcheck'
|
||||||
|
: 'https://api.fastcheck.store';
|
||||||
|
|
||||||
// Legacy QR endpoint kept for the SBP amount → payload redirect flow.
|
// Legacy QR endpoint kept for the SBP amount → payload redirect flow.
|
||||||
export const QR_API = 'https://qr.vitanova.network:567/qr';
|
export const QR_API = isDevMode()
|
||||||
|
? '/proxy/legacy-qr/qr'
|
||||||
|
: 'https://qr.vitanova.network:567/qr';
|
||||||
|
|
||||||
// New QR Vitanova API (dynamic QR, settings, polling).
|
// New QR Vitanova API (dynamic QR, settings, polling).
|
||||||
export const QR_VITANOVA_API = 'https://qr.vitanova.network/api';
|
export const QR_VITANOVA_API = isDevMode()
|
||||||
|
? '/proxy/qr-vitanova/api'
|
||||||
|
: 'https://qr.vitanova.network/api';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Component, computed, inject, signal } from '@angular/core';
|
import { Component, computed, inject, isDevMode, signal } from '@angular/core';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
@@ -30,7 +30,9 @@ export class LegacyPayPage {
|
|||||||
|
|
||||||
private t(key: string): string { return this.i18n.translate(key); }
|
private t(key: string): string { return this.i18n.translate(key); }
|
||||||
|
|
||||||
private readonly LEGACY_API = 'https://qr.vitanova.network:567/qr';
|
private readonly LEGACY_API = isDevMode()
|
||||||
|
? '/proxy/legacy-qr/qr'
|
||||||
|
: 'https://qr.vitanova.network:567/qr';
|
||||||
|
|
||||||
amount = signal<number | null>(null);
|
amount = signal<number | null>(null);
|
||||||
note = signal<string>('');
|
note = signal<string>('');
|
||||||
@@ -40,8 +42,9 @@ export class LegacyPayPage {
|
|||||||
|
|
||||||
paymentId = signal<string>('');
|
paymentId = signal<string>('');
|
||||||
|
|
||||||
readonly isMobile: boolean = typeof navigator !== 'undefined'
|
readonly isMobile: boolean = typeof window !== 'undefined'
|
||||||
&& /android|iphone|ipad|ipod|mobile/i.test(navigator.userAgent);
|
&& (navigator.maxTouchPoints > 0 || 'ontouchstart' in window
|
||||||
|
|| /android|iphone|ipad|ipod|mobile/i.test(navigator.userAgent));
|
||||||
|
|
||||||
canPay = computed(() => {
|
canPay = computed(() => {
|
||||||
const a = this.amount();
|
const a = this.amount();
|
||||||
|
|||||||
Reference in New Issue
Block a user