Whoops, looks like something went wrong - Client Viewing Invoice

Getting this error after last upgrade. Here is the output of larvel.log

[2017-01-04 17:20:29] production.ERROR: exception ‘ErrorException’ with message ‘Trying to get property of non-object’ in /home/nwdinc/public_html/clients/app/Ninja/PaymentDrivers/BasePaymentDriver.php:794 Stack trace: #0 /home/nwdinc/public_html/clients/app/Ninja/PaymentDrivers/BasePaymentDriver.php(794): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, ‘Trying to get p…’, ‘/home/nwdinc/pu…’, 794, Array) #1 /home/nwdinc/public_html/clients/app/Http/Controllers/ClientPortalController.php(173): App\Ninja\PaymentDrivers\BasePaymentDriver->tokenLinks() #2 /home/nwdinc/public_html/clients/app/Http/Controllers/ClientPortalController.php(103): App\Http\Controllers\ClientPortalController->getPaymentTypes(Object(App\Models\Account), Object(App\Models\Client), Object(App\Models\Invitation)) #3 [internal function]: App\Http\Controllers\ClientPortalController->view(‘8mfSvYgahEXLtl1…’) #4 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(9482): call_user_func_array(Array, Array) #5 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(9544): Illuminate\Routing\Controller->callAction(‘view’, Array) #6 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(9524): Illuminate\Routing\ControllerDispatcher->call(Object(App\Http\Controllers\ClientPortalController), Object(Illuminate\Routing\Route), ‘view’) #7 [internal function]: Illuminate\Routing\ControllerDispatcher->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #8 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #9 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #10 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #11 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(9525): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #12 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(9512): Illuminate\Routing\ControllerDispatcher->callWithinStack(Object(App\Http\Controllers\ClientPortalController), Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), ‘view’) #13 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(8582): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), ‘App\Http\Contro…’, ‘view’) #14 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(8569): Illuminate\Routing\Route->runController(Object(Illuminate\Http\Request)) #15 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(8283): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request)) #16 [internal function]: Illuminate\Routing\Router->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #17 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #18 /home/nwdinc/public_html/clients/app/Http/Middleware/Authenticate.php(90): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #19 [internal function]: App\Http\Middleware\Authenticate->handle(Object(Illuminate\Http\Request), Object(Closure), ‘client’) #20 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #21 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #22 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #23 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #24 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #25 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(8284): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #26 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(8275): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request)) #27 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(8265): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request)) #28 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(2419): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #29 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http{closure}(Object(Illuminate\Http\Request)) #30 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(52): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #31 /home/nwdinc/public_html/clients/app/Http/Middleware/StartupCheck.php(196): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #32 [internal function]: App\Http\Middleware\StartupCheck->handle(Object(Illuminate\Http\Request), Object(Closure)) #33 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #34 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #35 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #36 /home/nwdinc/public_html/clients/app/Http/Middleware/QueryLogging.php(29): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #37 [internal function]: App\Http\Middleware\QueryLogging->handle(Object(Illuminate\Http\Request), Object(Closure)) #38 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #39 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #40 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #41 /home/nwdinc/public_html/clients/app/Http/Middleware/DuplicateSubmissionCheck.php(36): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #42 [internal function]: App\Http\Middleware\DuplicateSubmissionCheck->handle(Object(Illuminate\Http\Request), Object(Closure)) #43 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #44 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #45 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #46 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(3225): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #47 /home/nwdinc/public_html/clients/app/Http/Middleware/VerifyCsrfToken.php(42): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #48 [internal function]: App\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure)) #49 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #50 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #51 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #52 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(13531): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #53 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #54 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #55 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #56 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #57 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(12021): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #58 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure)) #59 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #60 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #61 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #62 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(13270): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #63 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure)) #64 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #65 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #66 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #67 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(13207): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #68 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure)) #69 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #70 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #71 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #72 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(3286): Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #73 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure)) #74 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10021): call_user_func_array(Array, Array) #75 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline{closure}(Object(Illuminate\Http\Request)) #76 /home/nwdinc/public_html/clients/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(32): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #77 [internal function]: Illuminate\Routing\Pipeline->Illuminate\Routing{closure}(Object(Illuminate\Http\Request)) #78 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(10006): call_user_func(Object(Closure), Object(Illuminate\Http\Request)) #79 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(2366): Illuminate\Pipeline\Pipeline->then(Object(Closure)) #80 /home/nwdinc/public_html/clients/bootstrap/cache/compiled.php(2350): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request)) #81 /home/nwdinc/public_html/clients/public/index.php(52): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #82 {main} [] []

Which version are you upgrading from?

Run select * from payment_types; to check the payment types table is populated. You can add dd($paymentMethod->payment_type_id) before line 794 in app/Ninja/PaymentDrivers/BasePaymentDriver.php to see which payment type it’s linked to.

I upgraded from 2.6.x to 2.9.3

The payment table is populated.

When I add the line of code you suggest. I get a 0 as a response instead of the Whoops error

Do you see any errors if you load /update

No I did not see any errors.

The client did have a stripe account, but that person of the company left, so we removed the account from stripe, so the new information could be entered. Could this some how be related?

It may explain the error. You can run this query to check how many records are like this:

select * from payment_methods where payment_type_id = 0;

There is 1 record that shows up with that query. How do I set it to a new stripe account?

Ok, I set the payment type to 5 and it appears to allow them to enter a new credit card. Will that update the system when they do?

Can you access the client portal dashboard, there’s a link on the client overview page. From there you can delete the card on file.

Otherwise you can try to fix the data by setting the payment_type_id value to 6 for that record.

Yes, it should.