diff --git a/app/Http/Controllers/ExportController.php b/app/Http/Controllers/ExportController.php index f459a2733386..c0d8a94ac808 100644 --- a/app/Http/Controllers/ExportController.php +++ b/app/Http/Controllers/ExportController.php @@ -60,7 +60,10 @@ class ExportController extends BaseController $url = \Illuminate\Support\Facades\URL::temporarySignedRoute('protected_download', now()->addHour(), ['hash' => $hash]); Cache::put($hash, $url, now()->addHour()); - CompanyExport::dispatch(auth()->user()->getCompany(), auth()->user(), $hash); + /**@var \App\Models\User $user */ + $user = auth()->user(); + + CompanyExport::dispatch($user->getCompany(), $user, $hash); return response()->json(['message' => 'Processing', 'url' => $url], 200); } diff --git a/app/PaymentDrivers/PayPalPPCPPaymentDriver.php b/app/PaymentDrivers/PayPalPPCPPaymentDriver.php index e826b2121828..e3469bd3c4a1 100644 --- a/app/PaymentDrivers/PayPalPPCPPaymentDriver.php +++ b/app/PaymentDrivers/PayPalPPCPPaymentDriver.php @@ -282,6 +282,10 @@ class PayPalPPCPPaymentDriver extends BaseDriver $invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id)); + $description = collect($invoice->line_items)->map(function ($item){ + return $item->notes; + })->implode("\n"); + $order = [ "intent" => "CAPTURE", "payer" => [ @@ -316,6 +320,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver "items"=> [ [ "name" => ctrans('texts.invoice_number').'# '.$invoice->number, + "description" => substr($description, 0, 127), "quantity" => "1", "unit_amount" => [ "currency_code" => $this->client->currency()->code, @@ -367,7 +372,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver 'Content-type' => 'application/json', 'Accept-Language' => 'en_US', 'PayPal-Partner-Attribution-Id' => 'invoiceninja_SP_PPCP', - 'PayPal-Request-Id' => Str::uuid(), + 'PayPal-Request-Id' => (string) Str::uuid(), ], $headers); } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 028eeb4dffc7..6b95c12cc335 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -276,7 +276,9 @@ use App\Listeners\RecurringExpense\RecurringExpenseArchivedActivity; use App\Listeners\RecurringExpense\RecurringExpenseRestoredActivity; use App\Listeners\RecurringInvoice\RecurringInvoiceArchivedActivity; use App\Listeners\RecurringInvoice\RecurringInvoiceRestoredActivity; +use App\Listeners\Request\LogRequestSending; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; +use Illuminate\Http\Client\Events\RequestSending; class EventServiceProvider extends ServiceProvider { @@ -285,6 +287,16 @@ class EventServiceProvider extends ServiceProvider * */ protected $listen = [ + RequestSending::class => [ + LogRequestSending::class, + ], + // 'Illuminate\Http\Client\Events\ResponseReceived' => [ + // 'App\Listeners\LogResponseReceived', + // ], + // 'Illuminate\Http\Client\Events\ConnectionFailed' => [ + // 'App\Listeners\LogConnectionFailed', + // ], + AccountCreated::class => [ ], MessageSending::class => [