Getting this problem in Stripe test. Everything used to work in test, but when I created a new plan in Stripe, and deleted the original one, I now get the following error:
No such plan: monthly; one exists with a name of monthly, but its ID is primary.
Controller
$user->newSubscription('primary', 'monthly')->create($token, [ ]);
Plan details
ID: primary
Name: monthly
Price: $19.99 USD/month
Trial period: No trial
php artisan config:clear doesn't help. I'm using Laravel 5.2 and Cashier 6.0.
.env file
STRIPE_KEY=pk_test_...
STRIPE_SECRET=sk_test_....
config/services.php
'stripe' => [
'model' => App\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
],
It is important to differentiate between a Product identifier and a Plan identifier. Perhaps stripe has changed since many of the tutorials were written. It took me a few hours of searching to recognize this. As I'm new to stripe, it was easy to find the Product and Product Id, but the Plan Id was harder to find. In fact I had to "export plans" to a CSV from the product page to even get the ID for plan Id.
Hopefully this helps someone who was lost like I was
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With