From 5d9fd1482c537debcf0c4d12d35a5baf079acc8c Mon Sep 17 00:00:00 2001 From: denisdulici Date: Sun, 19 Jan 2020 00:41:27 +0300 Subject: [PATCH] formatting --- app/BulkActions/Sales/Invoices.php | 2 +- app/Events/Sale/PaymentReceived.php | 2 +- app/Http/Controllers/Sales/Invoices.php | 2 +- modules/OfflinePayments/Http/Controllers/Payment.php | 3 ++- modules/PaypalStandard/Http/Controllers/Payment.php | 3 ++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/BulkActions/Sales/Invoices.php b/app/BulkActions/Sales/Invoices.php index d502593e8..d5d9ca2be 100644 --- a/app/BulkActions/Sales/Invoices.php +++ b/app/BulkActions/Sales/Invoices.php @@ -41,7 +41,7 @@ class Invoices extends BulkAction $invoices = $this->getSelectedRecords($request); foreach ($invoices as $invoice) { - event(new PaymentReceived($invoice, [])); + event(new PaymentReceived($invoice)); } } diff --git a/app/Events/Sale/PaymentReceived.php b/app/Events/Sale/PaymentReceived.php index fb124ce79..4861f5589 100644 --- a/app/Events/Sale/PaymentReceived.php +++ b/app/Events/Sale/PaymentReceived.php @@ -17,7 +17,7 @@ class PaymentReceived * * @param $invoice */ - public function __construct($invoice, $request) + public function __construct($invoice, $request = []) { $this->invoice = $invoice; $this->request = $request; diff --git a/app/Http/Controllers/Sales/Invoices.php b/app/Http/Controllers/Sales/Invoices.php index 2ac4cfe0c..3c5f9f46f 100644 --- a/app/Http/Controllers/Sales/Invoices.php +++ b/app/Http/Controllers/Sales/Invoices.php @@ -379,7 +379,7 @@ class Invoices extends Controller public function markPaid(Invoice $invoice) { try { - event(new \App\Events\Sale\PaymentReceived($invoice, [])); + event(new \App\Events\Sale\PaymentReceived($invoice)); $message = trans('invoices.messages.marked_paid'); diff --git a/modules/OfflinePayments/Http/Controllers/Payment.php b/modules/OfflinePayments/Http/Controllers/Payment.php index 769d5f336..6b1076cc1 100644 --- a/modules/OfflinePayments/Http/Controllers/Payment.php +++ b/modules/OfflinePayments/Http/Controllers/Payment.php @@ -3,6 +3,7 @@ namespace Modules\OfflinePayments\Http\Controllers; use App\Abstracts\Http\PaymentController; +use \App\Events\Sale\PaymentReceived; use App\Http\Requests\Portal\InvoicePayment as PaymentRequest; use App\Models\Sale\Invoice; use Illuminate\Http\Request; @@ -69,7 +70,7 @@ class Payment extends PaymentController public function confirm(Invoice $invoice, Request $request) { try { - event(new \App\Events\Sale\PaymentReceived($invoice, $request)); + event(new PaymentReceived($invoice, $request)); $message = trans('messages.success.added', ['type' => trans_choice('general.payments', 1)]); diff --git a/modules/PaypalStandard/Http/Controllers/Payment.php b/modules/PaypalStandard/Http/Controllers/Payment.php index 2828c87b2..a1fffe1ba 100644 --- a/modules/PaypalStandard/Http/Controllers/Payment.php +++ b/modules/PaypalStandard/Http/Controllers/Payment.php @@ -3,6 +3,7 @@ namespace Modules\PaypalStandard\Http\Controllers; use App\Abstracts\Http\PaymentController; +use App\Events\Sale\PaymentReceived; use App\Http\Requests\Portal\InvoicePayment as PaymentRequest; use App\Models\Sale\Invoice; use GuzzleHttp\Client; @@ -117,7 +118,7 @@ class Payment extends PaymentController $total_paid_match = ((double) $request['mc_gross'] == $invoice->amount); if ($receiver_match && $total_paid_match) { - event(new \App\Events\Sale\PaymentReceived($invoice, $request)); + event(new PaymentReceived($invoice, $request)); } if (!$receiver_match) {