Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Geser's avatar
Level 2

Spark Subscription Server Error "Undefined property of Stripe\Customer instance: discount"

I've been tinkering around with Spark for a week or so and I have set up Stripe subscriptions that seem to almost be working(?). This error occurs on a non teams (no team subscriptions) deployment of Spark.

The error I'm troubleshooting is a Server 500 error. When I look in the error.log for Nginx there is the following:

2019/12/04 [error] 924#924: *290 FastCGI sent in stderr: "PHP message: Stripe Notice: Undefined property of Stripe\Customer instance: discount" while reading response header from upstream, client: X.X.X.X, server: spark.test, request: "GET /settings/teams/coupon/1 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.3-fpm.sock:", host: "spark.test", referrer: "http://spark.test/settings/teams/1"

Is it because the form validation tries to fetch a coupon for a non-existent team? Where can I fully disable the teams feature so that my non-teams Spark works properly? (This doesn't seem to be covered anywhere in the docs.)

0 likes
2 replies
Geser's avatar
Geser
OP
Best Answer
Level 2

Fixed! Turns out I was trying to use a Stripe prod_id when I needed a Stripe plan_id.

Laravel/Telescope was the key to diagnosing the error. (I was unable to use XDebug with VSCode.)

Stripe\Exception\InvalidRequestException
No such plan: prod_XXXXXXXXX

...easy when you get the right error message. (NB: Use TDD with Telescope to avoid this)

Sinnbeck's avatar

Remember to mark your answer as Best to help others :)

Please or to participate in this conversation.