Retrieve list of subscription plans from stripe with Laravel 5.4
Asked Answered
S

1

6

How to obtain a list of subscription plans from stripe with Laravel 5.4?

Is there even a way to retrieve a list of subscription plans?

the following checks if a user is subscribed to a plan

@if(Auth::user()->subscribed('dailyTest'))

but is there something like

@foreach (Stripe::plans() as $plan)
Saltwater answered 27/9, 2017 at 14:39 Comment(1)
I'd also welcome this feature.Errolerroll
S
13

In your controller you should be able to do the following:

\Stripe\Stripe::setApiKey(config('services.stripe.secret'));
$plans = \Stripe\Plan::all();

$plans will contain a collection of all the plans that are set up in Stripe.

Stitching answered 5/4, 2018 at 8:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.