feat: add payer_dni field and validation for transfer payments, update related logic and tests

This commit is contained in:
2026-07-12 19:48:56 +00:00
parent ca4fea6bcd
commit ca7a2ae55c
7 changed files with 102 additions and 4 deletions

View File

@@ -54,7 +54,7 @@ class TelepagosWebhookService
$dni = substr($cuit, 2, -1);
$compra = Purchase::where('tenant_codigo', $tenantCodigo)
->whereRaw("REPLACE(dni, '.', '') = ?", [$dni])
->where('payer_dni', $dni)
->whereIn('status', [Purchase::STATUS_CREATED, Purchase::STATUS_PENDING_PAYMENT])
->where('payment_method', 'transfer')
->where('total', $amount)