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