mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Disable gateway refund options for GoCardless
This commit is contained in:
parent
e7aedf1270
commit
654bf7a23f
@ -271,8 +271,10 @@ class CompanySettings extends BaseSettings
|
||||
public $use_credits_payment = 'off'; //always, option, off //@implemented
|
||||
public $hide_empty_columns_on_pdf = false;
|
||||
public $email_from_name = '';
|
||||
public $auto_archive_invoice_cancelled = false;
|
||||
|
||||
public static $casts = [
|
||||
'auto_archive_invoice_cancelled' => 'bool',
|
||||
'email_from_name' => 'string',
|
||||
'show_all_tasks_client_portal' => 'string',
|
||||
'entity_send_time' => 'int',
|
||||
|
@ -107,6 +107,8 @@ class ClientController extends BaseController
|
||||
*/
|
||||
public function index(ClientFilters $filters)
|
||||
{
|
||||
set_time_limit(45);
|
||||
|
||||
$clients = Client::filter($filters);
|
||||
|
||||
return $this->listResponse($clients);
|
||||
|
@ -119,6 +119,8 @@ class InvoiceController extends BaseController
|
||||
*/
|
||||
public function index(InvoiceFilters $filters)
|
||||
{
|
||||
set_time_limit(45);
|
||||
|
||||
$invoices = Invoice::filter($filters);
|
||||
|
||||
return $this->listResponse($invoices);
|
||||
|
@ -569,8 +569,6 @@ class BaseImport
|
||||
'company' => $this->company,
|
||||
];
|
||||
|
||||
nlog($this->company->company_users);
|
||||
|
||||
$nmo = new NinjaMailerObject;
|
||||
$nmo->mailable = new ImportCompleted($this->company, $data);
|
||||
$nmo->company = $this->company;
|
||||
|
@ -159,7 +159,7 @@ class Gateway extends StaticModel
|
||||
break;
|
||||
case 52:
|
||||
return [
|
||||
GatewayType::BANK_TRANSFER => ['refund' => true, 'token_billing' => true, 'webhooks' => [' ']], // GoCardless
|
||||
GatewayType::BANK_TRANSFER => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']], // GoCardless
|
||||
GatewayType::DIRECT_DEBIT => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
||||
GatewayType::SEPA => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
||||
GatewayType::INSTANT_BANK_PAY => ['refund' => false, 'token_billing' => true, 'webhooks' => [' ']],
|
||||
|
@ -186,7 +186,7 @@ class PaymentRepository extends BaseRepository {
|
||||
|
||||
TransactionLog::dispatch(TransactionEvent::PAYMENT_MADE, $transaction, $payment->company->db);
|
||||
|
||||
return $payment->fresh();
|
||||
return $payment->refresh();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -52,6 +52,8 @@ class HandleCancellation extends AbstractService
|
||||
//adjust client balance
|
||||
$this->invoice->client->service()->updateBalance($adjustment)->save();
|
||||
|
||||
$this->invoice->service()->workFlow()->save();
|
||||
|
||||
event(new InvoiceWasCancelled($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||
|
||||
$transaction = [
|
||||
|
@ -546,6 +546,19 @@ class InvoiceService
|
||||
event(new InvoiceWasArchived($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
if ($this->invoice->status_id == Invoice::STATUS_CANCELLED && $this->invoice->client->getSetting('auto_archive_invoice_cancelled')) {
|
||||
/* Throws: Payment amount xxx does not match invoice totals. */
|
||||
|
||||
if ($this->invoice->trashed())
|
||||
return $this;
|
||||
|
||||
$this->invoice->delete();
|
||||
|
||||
event(new InvoiceWasArchived($this->invoice, $this->invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
Loading…
x
Reference in New Issue
Block a user