feat(purchase-status): remove mock data and implement actual purchase status fetching
This commit is contained in:
@@ -47,4 +47,14 @@ export class CheckoutService {
|
||||
}
|
||||
return response.data;
|
||||
}
|
||||
|
||||
async getPurchase(tenantCode: string, purchaseId: string | number): Promise<{ payment_status: string }> {
|
||||
const response = await firstValueFrom(
|
||||
this.http.get<{ data: { payment_status: string } }>(`${environment.url}tenants/${tenantCode}/compras/${purchaseId}`)
|
||||
);
|
||||
if (!response?.data) {
|
||||
throw new Error('Error al obtener la compra.');
|
||||
}
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user