formatting

This commit is contained in:
denisdulici 2020-01-19 00:41:27 +03:00
parent fb5d166606
commit 5d9fd1482c
5 changed files with 7 additions and 5 deletions

View File

@ -41,7 +41,7 @@ class Invoices extends BulkAction
$invoices = $this->getSelectedRecords($request); $invoices = $this->getSelectedRecords($request);
foreach ($invoices as $invoice) { foreach ($invoices as $invoice) {
event(new PaymentReceived($invoice, [])); event(new PaymentReceived($invoice));
} }
} }

View File

@ -17,7 +17,7 @@ class PaymentReceived
* *
* @param $invoice * @param $invoice
*/ */
public function __construct($invoice, $request) public function __construct($invoice, $request = [])
{ {
$this->invoice = $invoice; $this->invoice = $invoice;
$this->request = $request; $this->request = $request;

View File

@ -379,7 +379,7 @@ class Invoices extends Controller
public function markPaid(Invoice $invoice) public function markPaid(Invoice $invoice)
{ {
try { try {
event(new \App\Events\Sale\PaymentReceived($invoice, [])); event(new \App\Events\Sale\PaymentReceived($invoice));
$message = trans('invoices.messages.marked_paid'); $message = trans('invoices.messages.marked_paid');

View File

@ -3,6 +3,7 @@
namespace Modules\OfflinePayments\Http\Controllers; namespace Modules\OfflinePayments\Http\Controllers;
use App\Abstracts\Http\PaymentController; use App\Abstracts\Http\PaymentController;
use \App\Events\Sale\PaymentReceived;
use App\Http\Requests\Portal\InvoicePayment as PaymentRequest; use App\Http\Requests\Portal\InvoicePayment as PaymentRequest;
use App\Models\Sale\Invoice; use App\Models\Sale\Invoice;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@ -69,7 +70,7 @@ class Payment extends PaymentController
public function confirm(Invoice $invoice, Request $request) public function confirm(Invoice $invoice, Request $request)
{ {
try { 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)]); $message = trans('messages.success.added', ['type' => trans_choice('general.payments', 1)]);

View File

@ -3,6 +3,7 @@
namespace Modules\PaypalStandard\Http\Controllers; namespace Modules\PaypalStandard\Http\Controllers;
use App\Abstracts\Http\PaymentController; use App\Abstracts\Http\PaymentController;
use App\Events\Sale\PaymentReceived;
use App\Http\Requests\Portal\InvoicePayment as PaymentRequest; use App\Http\Requests\Portal\InvoicePayment as PaymentRequest;
use App\Models\Sale\Invoice; use App\Models\Sale\Invoice;
use GuzzleHttp\Client; use GuzzleHttp\Client;
@ -117,7 +118,7 @@ class Payment extends PaymentController
$total_paid_match = ((double) $request['mc_gross'] == $invoice->amount); $total_paid_match = ((double) $request['mc_gross'] == $invoice->amount);
if ($receiver_match && $total_paid_match) { if ($receiver_match && $total_paid_match) {
event(new \App\Events\Sale\PaymentReceived($invoice, $request)); event(new PaymentReceived($invoice, $request));
} }
if (!$receiver_match) { if (!$receiver_match) {