From 05a92b7ec39920f56e17a5909b0bd7046aaf44ff Mon Sep 17 00:00:00 2001 From: ncoronel Date: Wed, 8 Jul 2026 10:05:49 -0300 Subject: [PATCH] feat: update purchase query in TelepagosWebhookService to handle multiple statuses and normalize DNI format --- app/Domains/Integration/Services/TelepagosWebhookService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Domains/Integration/Services/TelepagosWebhookService.php b/app/Domains/Integration/Services/TelepagosWebhookService.php index 6252690..421af1c 100644 --- a/app/Domains/Integration/Services/TelepagosWebhookService.php +++ b/app/Domains/Integration/Services/TelepagosWebhookService.php @@ -54,8 +54,8 @@ class TelepagosWebhookService $dni = substr($cuit, 2, -1); $compra = Purchase::where('tenant_codigo', $tenantCodigo) - ->where('dni', $dni) - ->where('status', Purchase::STATUS_PENDING_PAYMENT) + ->whereRaw("REPLACE(dni, '.', '') = ?", [$dni]) + ->whereIn('status', [Purchase::STATUS_CREATED, Purchase::STATUS_PENDING_PAYMENT]) ->where('payment_method', 'transfer') ->where('total', $amount) ->latest()