Merge pull request #5337 from mempool/nymkappa/invoice-check-http-code
[btcpay] handle new http code 204 when calling /payments/bitcoin/check
This commit is contained in:
		
						commit
						6177b97bd1
					
				| @ -74,7 +74,10 @@ export class BitcoinInvoiceComponent implements OnInit, OnChanges, OnDestroy { | |||||||
|     } |     } | ||||||
|     this.paymentStatusSubscription = this.apiService.getPaymentStatus$(this.invoice.btcpayInvoiceId).pipe( |     this.paymentStatusSubscription = this.apiService.getPaymentStatus$(this.invoice.btcpayInvoiceId).pipe( | ||||||
|       retry({ delay: () => timer(2000)}) |       retry({ delay: () => timer(2000)}) | ||||||
|     ).subscribe((result) => { |     ).subscribe((response) => { | ||||||
|  |       if (response.status === 204 || response.status === 404) { | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|       this.paymentStatus = 3; |       this.paymentStatus = 3; | ||||||
|       this.completed.emit(); |       this.completed.emit(); | ||||||
|     }); |     }); | ||||||
|  | |||||||
| @ -181,7 +181,7 @@ export class ServicesApiServices { | |||||||
|     return this.httpClient.get<any[]>(`${this.stateService.env.SERVICES_API}/payments/bitcoin/invoice?id=${invoiceId}`); |     return this.httpClient.get<any[]>(`${this.stateService.env.SERVICES_API}/payments/bitcoin/invoice?id=${invoiceId}`); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   getPaymentStatus$(orderId: string): Observable<any[]> { |   getPaymentStatus$(orderId: string): Observable<any> { | ||||||
|     return this.httpClient.get<any[]>(`${this.stateService.env.SERVICES_API}/payments/bitcoin/check?order_id=${orderId}`); |     return this.httpClient.get<any>(`${this.stateService.env.SERVICES_API}/payments/bitcoin/check?order_id=${orderId}`, { observe: 'response' }); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user