如何解决在 Laravel Cashier 中创建一次性订阅
我开发了一些游戏,用户可以订阅这些游戏。我有 3 种订阅方式。
- 每月
- 每年
- 一次性。
我使用了以下代码。
$subscription = auth()->user()->newSubscription($subscriptionName,$plan->stripe_id)->withMetaData(['game' => $game->name])->create(null,[
'email' => $user->email,'name' => $user->name,['metadata' => ['game' => $game->name]],],$subscriptionOptions);
但为此,当我使用 one-time
订阅方法时出现以下错误。谁能帮我解决这个问题?谢谢
Stripe\Exception\InvalidRequestException
The price specified is set to `type=one_time` but this field only accepts prices with `type=recurring`.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。