【发布时间】:2021-04-01 21:27:21
【问题描述】:
我想使用 Laravel/Plan Facade 创建一次性付款计划。我可以创建月度、年度计划,但我不知道如何实现一次性付款计划,因为我们可以在条纹仪表板上创建产品时创建一次性付款计划。下面是我创建每月、每年、每周或每天但不是终身/一次性付款的代码。
$monthlyPlan = Stripe\Plan::create([
"product" => $stripeProduct->id,
"amount" => $request->input('amount_month'),
"interval" => 'month',
"currency" => $request->input('currency')
]);
$yearlyPlan = Stripe\Plan::create([
"product" => $stripeProduct->id,
"amount" => $request->input('amount_year'),
"interval" => 'year',
"currency" => $request->input('currency')
]);
【问题讨论】:
-
对于
lifetime,您创建自己的计划并使用条纹来收取该金额。这些计费计划,例如订阅 -
我怎样才能像上面的代码一样创建这个计划?
-
不要在stripe中创建计划,在你自己的数据库中创建
-
我可以通过代码创建它吗?或者它应该只在条纹仪表板上,在条纹仪表板上我可以创建一个时间计划,但我想通过条纹 api 创建它
标签: laravel stripe-payments laravel-cashier