本文介绍了条纹-无法创建计划的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Laravel Cashier 来实施定期付款系统.我需要一个计划进行订阅. Stripe doc 说:您可以使用API​​或在Stripe仪表板中创建计划."但是,当我通过单击那里的链接进入仪表板时,看不到创建任何计划的任何方法.

I am using Laravel Cashier to implement a recurring payment system. I need a plan to make subscription. Stripe doc says : "You can create plans using the API, or in the Stripe Dashboard." But when I go to dashboard by clicking on the link there , I do not see any way to create any plan.

问题:那我该如何在其中创建一个计划,以便可以通过以下方式在服务器端Laravel Cashier Stripe实现中使用它?

Question : So how do I create a plan there so that I can use it in the server side Laravel Cashier Stripe implementation in the following way ?

$user->newSubscription('main', $plan)->create($token, ['email' =>$email,]);

我需要将该计划用作$plan变量的值.

I need the plan to be used as the value of $plan variable .

推荐答案

仪表盘最近已更新为使用较新的Price抽象.您可以使用新的定期价格对象代替计划.将$ plan的值设置为在仪表板上创建的价格 的ID.价格具有price_xxx之类的ID.请注意,这仅在价格为循环价格时才有效.

The dashboard was recently updated to use the newer Price abstraction. You can use the new recurring Price objects in place of plans. Set the value of $plan to the ID of a Price created in the dashboard. Prices have IDs like price_xxx. Note that this will only work if the price is a recurring price.

这篇关于条纹-无法创建计划的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 01:14