Stripe - cannot create a plan

折月煮酒 提交于 2020-06-22 04:26:44

问题


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.

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,]);

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


回答1:


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.



来源:https://stackoverflow.com/questions/62238551/stripe-cannot-create-a-plan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!