polling
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user