【问题标题】:Laravel Cashier Braintree Multiple Subscription for one User一个用户的 Laravel Cashier Braintree 多个订阅
【发布时间】:2019-08-01 22:47:38
【问题描述】:

我在基于年度订阅的应用程序上使用 laravel 收银员,并且年度订阅运行良好。但现在我想让用户订阅一年以上。所以他们应该能够提前支付 3 年或 5 年的费用,而我在网上找不到任何关于此的内容。

目前,这就是我创建订阅的方式

if ($account->newSubscription('main', $plan->braintree_plan)->create($request->payment_method_nonce)) {
          return ['success' => true, 'message' => 'Subscription Successful'];
        }else{
          return response()->json(['error' => 'Error msg'], 401);
        }

【问题讨论】:

    标签: laravel laravel-5 braintree laravel-cashier


    【解决方案1】:

    您可以在订阅用户时使用收银员的incrementQuantity()。您可以询问用户他们想要订阅的年数,然后您可以使用上述方法实现您的目标。

    阅读更多here

    【讨论】:

      猜你喜欢
      • 2014-08-04
      • 2016-07-31
      • 2017-04-06
      • 2021-12-20
      • 2020-07-25
      • 2020-02-29
      • 2015-05-01
      • 2021-04-02
      • 2018-01-15
      相关资源
      最近更新 更多