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()