This commit is contained in:
sdarbinyan
2026-06-29 22:15:19 +04:00
parent 0977f302a4
commit 960901d2b2
2 changed files with 11 additions and 1 deletions

View File

@@ -282,7 +282,11 @@ export class CartComponent implements OnDestroy {
.pipe(
take(this.maxChecks), // maximum 36 checks (3 minutes)
exhaustMap(() => {
return this.apiService.checkCartPaymentStatus(this.paymentId()).pipe(
const statusRequest = this.selectedPaymentMethod() === 'card'
? this.apiService.checkCartCardPaymentStatus(this.paymentId())
: this.apiService.checkCartPaymentStatus(this.paymentId());
return statusRequest.pipe(
timeout(8000),
catchError((err) => {
console.error('Error checking payment status:', err);

View File

@@ -533,6 +533,12 @@ export class ApiService {
);
}
checkCartCardPaymentStatus(orderId: string): Observable<QrDynamicStatusResponse> {
return this.http.get<QrDynamicStatusResponse>(
`${this.qrBaseUrl}/card/${this.cartPaymentPartnerId}/${encodeURIComponent(orderId)}`
);
}
checkPaymentStatus(partnerQrId: string, qrId: string): Observable<QrDynamicStatusResponse> {
return this.http.get<QrDynamicStatusResponse>(
`${this.qrBaseUrl}/qr/dynamic/${encodeURIComponent(partnerQrId)}/${encodeURIComponent(qrId)}`