【问题标题】:Retrieve list of subscription plans from stripe with Laravel 5.4使用 Laravel 5.4 从条带中检索订阅计划列表
【发布时间】:2018-03-09 02:39:47
【问题描述】:

如何使用 Laravel 5.4 从 Stripe 获取订阅计划列表?

有没有办法检索订阅计划列表?

以下检查用户是否订阅了计划

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

但是有没有类似的东西

@foreach (Stripe::plans() as $plan)

【问题讨论】:

  • 我也欢迎这个功能。

标签: php laravel-5.4 laravel-cashier


【解决方案1】:

在您的控制器中,您应该能够执行以下操作:

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

$plans 将包含在 Stripe 中设置的所有计划的集合。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-12
    • 2018-01-15
    • 2021-12-01
    • 2020-01-12
    • 2021-12-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多