feat: update purchase query in TelepagosWebhookService to handle multiple statuses and normalize DNI format
This commit is contained in:
@@ -54,8 +54,8 @@ class TelepagosWebhookService
|
|||||||
$dni = substr($cuit, 2, -1);
|
$dni = substr($cuit, 2, -1);
|
||||||
|
|
||||||
$compra = Purchase::where('tenant_codigo', $tenantCodigo)
|
$compra = Purchase::where('tenant_codigo', $tenantCodigo)
|
||||||
->where('dni', $dni)
|
->whereRaw("REPLACE(dni, '.', '') = ?", [$dni])
|
||||||
->where('status', Purchase::STATUS_PENDING_PAYMENT)
|
->whereIn('status', [Purchase::STATUS_CREATED, Purchase::STATUS_PENDING_PAYMENT])
|
||||||
->where('payment_method', 'transfer')
|
->where('payment_method', 'transfer')
|
||||||
->where('total', $amount)
|
->where('total', $amount)
|
||||||
->latest()
|
->latest()
|
||||||
|
|||||||
Reference in New Issue
Block a user