Stripe Import Customers Failure

Hi, we’re on self-hosted v.5.4.12 and are having issues with Stripe integration.

There’s not a lot of documentation and the video hosted at How to Integrate Stripe | Invoice Ninja is not accurate.

Primarily, whenever I try to Import Customers, i get a “500: Server Error”. The nginx error log shows:
“2022/08/31 09:53:53 [error] 767#767: 18 FastCGI sent in stderr: “PHP message: Stripe Notice: Undefined property of Stripe\Customer instance: sources” while reading response header from upstream, client: ...*, server: *****.com, request: “POST /api/v1/stripe/import_customers? HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php7.4-fpm.sock:”, host: .com", referrer: "https://.com/”

Secondarily, we are confused about where to enter customers. Do we enter them into invoice ninja first and then import? Or stripe first and then import? Or enter in both and then Verify? Verify seems to work but it shows 2 customers in Stripe and 1 in ninja. The 1 that is in both seemed (I think, that’s my best recollection as I’ve been tinkering for days with this) to have imported from Stripe but, as noted, that import no longer works. I successfully made a credit card payment by the one customer (me as a test) that is in both Stripe and Ninja.

I’ll also note that if i click on System Logs at Gateway Stripe, the wheel just spins and spins.

Any guidance would be greatly appreciated. Thanks

Hi,

@david any thoughts on the 500 error?

It would depend on your workflow, if your clients pays in the Invoice Ninja the app will automatically create a customer record in Stripe.

Do you see any errors in the browser console when the system logs fail to load?

Thank you. I’m not super familiar with browser console but in firefox, i get
Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. background.js:1

send moz-extension://4ea0acf8-ebf6-4792-b273-c9ae4b461026/background.js:1

In Chrome, i got the wheel spin but randomly got results. Tried again and it went to back to wheel spin.

@DavidGC

In storage/logs/laravel.log can you advise the full error along with the line number please.

Thank you.

I tried to import and the next log entry was at line 1458:
[2022-09-01 15:50:13] production.ERROR: Trying to get property ‘data’ of non-object {“userId”:1,“exception”:"[object] (ErrorException(code: 0): Trying to get property ‘data’ of non-object at /var/www/html/invoice-ninja/app/PaymentDrivers/Stripe/UpdatePaymentMethods.php:81)

@DavidGC

Thanks for reporting this.

I’ve checked a fix in for this edge case. It will be available in v5.5.19.

Hi, just upgraded to v5.5.21-C92 and am still having the errors described in this post. Thanks

Quick update that we’re finally able to create customers in Ninja and accept payments from those customers. Still get 500 error on import and the spinning wheel on Stripe System Logs.

Hi,

Can you please share details about the 500 from the logs in storage/logs

Sorry for delay, here’s the log entry:

[2022-09-19 19:03:30] production.ERROR: property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given {“userId”:1,“exception”:"[object] (TypeError(code: 0): property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given at /var/www/html/invoice-ninja/app/PaymentDrivers/Stripe/UpdatePaymentMethods.php:77)

@david any thoughts?

@DavidGC

I’ll check in a fix for this in the next release.