I have created a Plans table with some data. When I am trying to subscribe the plans, Laravel-Cashier says : No Such Plan.
What I am missing?
I also created a plan through Stripe dashboard, but nothing changed. How can I overcome this issue?
Here is my code :
Plans table have following fields:
protected $fillable = [
'id',
'name',
'stripe_plan',
'cost',
'interval',
'currency',
'description'
];
And controller code is:
public function create(Request $request)
{
// Getting choosed plan
$plan = Plans::findOrFail($request->plan);
$entity->newSubscription($plan->id,$plan->stripe_plan)->create($request->stripeToken);
//I tried put hardcoded plans, but still same error
// $entity->newSubscription('phone', 'phone')->create($request->stripeToken);
return redirect()->route('plans')->with('success', 'Your plan subscribed successfully');
}