mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-18 09:04:35 +01:00
39 lines
941 B
PHP
39 lines
941 B
PHP
<?php
|
|
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com).
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
use App\Models\RecurringInvoice;
|
|
use Livewire\Component;
|
|
|
|
class RecurringInvoiceCancellation extends Component
|
|
{
|
|
/**
|
|
* @var RecurringInvoice
|
|
*/
|
|
public $invoice;
|
|
|
|
public function processCancellation()
|
|
{
|
|
if ($this->invoice->subscription) {
|
|
return $this->invoice->subscription->service()->handleCancellation($this->invoice);
|
|
}
|
|
|
|
return redirect()->route('client.recurring_invoices.request_cancellation', ['recurring_invoice' => $this->invoice->hashed_id]);
|
|
}
|
|
|
|
public function render()
|
|
{
|
|
return render('components.livewire.recurring-invoice-cancellation');
|
|
}
|
|
}
|