[btcpay] handle new http code 204 when calling /payments/bitcoin/check api

This commit is contained in:
nymkappa 2024-07-13 21:07:13 +09:00
parent 66c5c303b3
commit 680e9562a0
No known key found for this signature in database
GPG Key ID: 92358FC85D9645DE
2 changed files with 6 additions and 3 deletions

View File

@ -74,7 +74,10 @@ export class BitcoinInvoiceComponent implements OnInit, OnChanges, OnDestroy {
}
this.paymentStatusSubscription = this.apiService.getPaymentStatus$(this.invoice.btcpayInvoiceId).pipe(
retry({ delay: () => timer(2000)})
).subscribe((result) => {
).subscribe((response) => {
if (response.status === 204 || response.status === 404) {
return;
}
this.paymentStatus = 3;
this.completed.emit();
});

View File

@ -181,7 +181,7 @@ export class ServicesApiServices {
return this.httpClient.get<any[]>(`${this.stateService.env.SERVICES_API}/payments/bitcoin/invoice?id=${invoiceId}`);
}
getPaymentStatus$(orderId: string): Observable<any[]> {
return this.httpClient.get<any[]>(`${this.stateService.env.SERVICES_API}/payments/bitcoin/check?order_id=${orderId}`);
getPaymentStatus$(orderId: string): Observable<any> {
return this.httpClient.get<any>(`${this.stateService.env.SERVICES_API}/payments/bitcoin/check?order_id=${orderId}`, { observe: 'response' });
}
}