feat(purchase-status): remove mock data and implement actual purchase status fetching

This commit is contained in:
2026-07-07 12:16:41 -03:00
parent d1e20460ac
commit e2605116c5
2 changed files with 20 additions and 8 deletions

View File

@@ -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;
}
}