gpt4 book ai didi

laravel - 没有这样的计划 : monthly; one exists with a name of monthly, 但它的 ID 是主要的 Laravel Cashier

转载 作者:行者123 更新时间:2023-12-01 13:41:00 25 4
gpt4 key购买 nike

在条纹测试中遇到这个问题。过去一切都在测试中工作,但是当我在 Stripe 中创建一个新计划并删除原始计划时,我现在收到以下错误:

No such plan: monthly; one exists with a name of monthly, but its ID is primary.

Controller
$user->newSubscription('primary', 'monthly')->create($token, [ ]);

计划详情
ID: primary
Name: monthly
Price: $19.99 USD/month
Trial period: No trial

php artisan config:clear 没有帮助。我使用的是 Laravel 5.2 和 Cashier 6.0。

.env 文件
STRIPE_KEY=pk_test_...
STRIPE_SECRET=sk_test_....

配置/服务.php
'stripe' => [
'model' => App\User::class,
'key' => env('STRIPE_KEY'),
'secret' => env('STRIPE_SECRET'),
],

最佳答案

区分产品标识符和计划标识符很重要。也许自从编写了许多教程以来,stripe 已经发生了变化。我花了几个小时的搜索才认识到这一点。因为我是 Stripe 的新手,所以很容易找到产品和产品 ID,但计划 ID 很难找到。事实上,我必须从产品页面将计划“导出”到 CSV 文件才能获得计划 ID 的 ID。

希望这能帮助像我一样迷路的人

关于laravel - 没有这样的计划 : monthly; one exists with a name of monthly, 但它的 ID 是主要的 Laravel Cashier,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40274681/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com