Envio de estado de cuotas.
This commit is contained in:
@ -27,6 +27,10 @@ class Cuota extends Model
|
||||
{
|
||||
return $this->pago->isAbonado();
|
||||
}
|
||||
public function isRechazada(): bool
|
||||
{
|
||||
return $this->pago->isRechazado();
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
|
@ -59,6 +59,10 @@ class Pago extends Model
|
||||
{
|
||||
return $this->currentEstado->tipoEstadoPago->descripcion === 'abonado';
|
||||
}
|
||||
public function isRechazado(): bool
|
||||
{
|
||||
return in_array($this->currentEstado->tipoEstadoPago->descripcion, ['devuelto', 'reemplazado', 'anulado']);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
|
@ -95,8 +95,8 @@ class Invoice extends AbstractEndPoint
|
||||
'due_date' => 'fecha',
|
||||
'subscription' => 'subscription',
|
||||
'amount' => 'valor',
|
||||
'is_paid' => null,
|
||||
'is_void' => null,
|
||||
'is_paid' => 'isPagada',
|
||||
'is_void' => 'isRechazada',
|
||||
'link_payment' => null,
|
||||
'metadata' => 'datosCuota',
|
||||
'receipt_type' => null,
|
||||
@ -123,6 +123,12 @@ class Invoice extends AbstractEndPoint
|
||||
$params[$key] = $this->datosCuota($data['cuota']);
|
||||
continue;
|
||||
}
|
||||
if ($ref === 'isPagada') {
|
||||
$params[$key] = $data['cuota']->isPagada();
|
||||
}
|
||||
if ($ref === 'isRechazada') {
|
||||
$params[$key] = $data['cuota']->isRechazada();
|
||||
}
|
||||
if ($ref === 'cuota_id') {
|
||||
$params[$key] = $data['cuota']->id;
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user