Laravel 收银员更新订阅多个商品
我已经在条纹上创建了一个订阅,用户可以为产品选择多种产品和数量。
我能够用带有收银员的多个项目创建订阅,如下所示,
$user->newSubscription('default', ['price_XXXXXXX', 'price_YYYYYYYYY'])
->quantity(5, 'price_XXXXXXX')
->quantity(10, 'price_YYYYYYYYY')
->checkout([
'success_url' => $successUrl?session_id={CHECKOUT_SESSION_ID}',
'cancel_url' => $nancelUrl,
]);
我需要在应用程序中更新订阅项目的功能。但是我无法在单个请求中更新多个项目的数量。
收银员具有以下功能,该功能将更新单个项目。
$subscription->updateQuantity(40, "price_XXXXXXXXXX");
这将为每个项目更新生成单独的发票。
但是我想在单个请求中更新多个项目数量,并且应该支付一次付款。
提前致谢
I have created a subscription on stripe in which users can choose multiple products and quantities for the products.
I am able to create the subscription with multiple items with cashier like below
$user->newSubscription('default', ['price_XXXXXXX', 'price_YYYYYYYYY'])
->quantity(5, 'price_XXXXXXX')
->quantity(10, 'price_YYYYYYYYY')
->checkout([
'success_url' => $successUrl?session_id={CHECKOUT_SESSION_ID}',
'cancel_url' => $nancelUrl,
]);
I need the functionality of updating the subscription items in my application. But I am not able to update the quantities of multiple items in a single request.
Cashier has the below function which will update a single item.
$subscription->updateQuantity(40, "price_XXXXXXXXXX");
which will generate a separate invoice for each item update.
But I want to update multiple items quantities in a single request and it should come under a single payment.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论