feat(purchase-status): implement purchase status page with loading and error handling
This commit is contained in:
@@ -37,4 +37,14 @@ export class CheckoutService {
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
async finalizePurchase(tenantCode: string, purchaseId: number): Promise<{ payment_status: string; status: string }> {
|
||||
const response = await firstValueFrom(
|
||||
this.http.post<{ data: { payment_status: string; status: string } }>(`${environment.url}tenants/${tenantCode}/compras/${purchaseId}/finalize`, {})
|
||||
);
|
||||
if (!response?.data) {
|
||||
throw new Error('Error al finalizar la compra.');
|
||||
}
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user