问题
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