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

lewisbhs's avatar

Laravel Spark: Stripe

I've been having a few problems with Laravel Spark, I've decided to rewrite my application this time but decided to opt for Stripe rather than BrainTree. I've registered a stripe account, and added my plans however spark is returning: "We had trouble validating your card. It's possible your card provider is preventing us from charging the card. Please contact your card provider or customer support."

I checked the console(networking) and logged this request: Whoops, looks like something went wrong. (1/1) InvalidRequest No such plan: 1-server

The plan has been added to the stripe dashboard, I've tried adding it to both parts(test and production) and it made no difference.

Has anyone had these sorts of issues with Spark? Thanks!

0 likes
5 replies
Cronix's avatar

Is Stripe in test mode, and are you using the test cc numbers?

lewisbhs's avatar

Here is some more information, still unsure about whats causing this - would having it on a local development environment effect it?

at ApiRequestor::_specificAPIError('{ "error": { "type": "invalid_request_error", "message": "No such plan: 10-server", "param": "plan" }}', 400, array('Server' => 'nginx', 'Date' => 'Fri, 18 Aug 2017 14:12:25 GMT', 'Content-Type' => 'application/json', 'Content-Length' => '120', 'Connection' => 'keep-alive', 'Access-Control-Allow-Credentials' => 'true', 'Access-Control-Allow-Methods' => 'GET, POST, HEAD, OPTIONS, DELETE', 'Access-Control-Allow-Origin' => '*', 'Access-Control-Max-Age' => '300', 'Cache-Control' => 'no-cache, no-store', 'Request-Id' => 'Hidden', 'Stripe-Version' => '2017-06-05'), array('error' => array('type' => 'invalid_request_error', 'message' => 'No such plan: 10-server', 'param' => 'plan')), array('type' => 'invalid_request_error', 'message' => 'No such plan: 10-server', 'param' => 'plan'))
RSUmer's avatar

I am experiencing the same problem but in my case it is Stripe Account replacing issue. I was using Stripe Account ABC then I shift to Stripe Account XYZ by modifying .env file but Laravel Spark is still processing cards through Stripe Account ABC and I am pulling out my hairs for last 3 hours.

If anyone has a solution to my problem please, write back!

Note: I am on Shared Hosting server without SSH!!! (headbang)

pscully's avatar

You may need to clear the Laravel cache to pull in the new .env file.

I was having the same error with "Your payment method could not be validated."

I realized I needed to add the plan to Stripe as well and then provide the plan ID (Stripe auto-creates this) in the Spark Provider. So for example with the demo plan "Basic" for "$10 per month" you need to add this plan to Stripe and then copy the planID provided as the second argument to Spark::plan().

so Spark::plan($name, $planID)

then you can chain on price() and features().

This should make then the plan go through with Stripe and get a successful response. The user will be subscribed to the plan.

The important piece is the Stripe planID which will look something like "plan_xxxxxxxxxx"

Please or to participate in this conversation.