@@ -1,11 +1,21 @@
|
||||
/**
|
||||
import { isDevMode } from '@angular/core';
|
||||
|
||||
/**
|
||||
* Endpoint constants for the Fastcheck backend (see public/api.txt).
|
||||
* 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.
|
||||
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).
|
||||
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 { ActivatedRoute } from '@angular/router';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
@@ -30,7 +30,9 @@ export class LegacyPayPage {
|
||||
|
||||
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);
|
||||
note = signal<string>('');
|
||||
@@ -40,8 +42,9 @@ export class LegacyPayPage {
|
||||
|
||||
paymentId = signal<string>('');
|
||||
|
||||
readonly isMobile: boolean = typeof navigator !== 'undefined'
|
||||
&& /android|iphone|ipad|ipod|mobile/i.test(navigator.userAgent);
|
||||
readonly isMobile: boolean = typeof window !== 'undefined'
|
||||
&& (navigator.maxTouchPoints > 0 || 'ontouchstart' in window
|
||||
|| /android|iphone|ipad|ipod|mobile/i.test(navigator.userAgent));
|
||||
|
||||
canPay = computed(() => {
|
||||
const a = this.amount();
|
||||
|
||||
Reference in New Issue
Block a user