feat: update purchase query in TelepagosWebhookService to handle multiple statuses and normalize DNI format

This commit is contained in:
ncoronel 2026-07-08 10:05:49 -03:00
parent f23029e785
commit 05a92b7ec3
1 changed files with 2 additions and 2 deletions

View File

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