@@ -53,18 +53,7 @@
|
|||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (qrPayUrl()) {
|
<button class="pay-btn" type="button" (click)="pay()" [disabled]="loading()">
|
||||||
<div class="qr-pay">
|
|
||||||
<img
|
|
||||||
[src]="'https://api.qrserver.com/v1/create-qr-code/?size=240x240&margin=8&data=' + qrPayUrl()"
|
|
||||||
width="240" height="240"
|
|
||||||
alt="SBP QR"
|
|
||||||
/>
|
|
||||||
<p class="qr-pay__hint">Отсканируйте QR-код в приложении вашего банка</p>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
|
|
||||||
<button class="pay-btn" type="button" (click)="pay()" [disabled]="loading() || !!qrPayUrl()">
|
|
||||||
<span class="pay-btn__icon">
|
<span class="pay-btn__icon">
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||||
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
|||||||
@@ -38,14 +38,9 @@ export class LegacyPayPage {
|
|||||||
note = signal<string>('');
|
note = signal<string>('');
|
||||||
error = signal<string>('');
|
error = signal<string>('');
|
||||||
loading = signal<boolean>(false);
|
loading = signal<boolean>(false);
|
||||||
qrPayUrl = signal<string>('');
|
|
||||||
|
|
||||||
paymentId = signal<string>('');
|
paymentId = signal<string>('');
|
||||||
|
|
||||||
readonly isMobile: boolean = typeof window !== 'undefined'
|
|
||||||
&& (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();
|
||||||
return !!this.paymentId() && a !== null && a > 0 && !this.loading();
|
return !!this.paymentId() && a !== null && a > 0 && !this.loading();
|
||||||
@@ -89,11 +84,7 @@ export class LegacyPayPage {
|
|||||||
next: (res) => {
|
next: (res) => {
|
||||||
this.loading.set(false);
|
this.loading.set(false);
|
||||||
if (res?.nspkurl) {
|
if (res?.nspkurl) {
|
||||||
if (this.isMobile) {
|
window.location.href = res.nspkurl;
|
||||||
window.location.href = res.nspkurl;
|
|
||||||
} else {
|
|
||||||
this.qrPayUrl.set(res.nspkurl);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
this.error.set(this.t('errors.payment_failed'));
|
this.error.set(this.t('errors.payment_failed'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user