【问题标题】:Stripe Subscription with Initial setup fee带初始安装费的 Stripe 订阅
【发布时间】:2017-08-29 13:14:16
【问题描述】:

我正在使用 Stripe 构建一个相对简单的基于订阅的应用。

我目前唯一真正的挂断是订阅需要初始设置费,我真的很难接受。

示例:
新用户注册 Subscription-A;订阅 A 的每月间隔价格为 10 美元。注册后,新用户将被收取 1 美元和 10 美元的一次性订阅费用,然后接下来的几个月只收取 10 美元。

目前我的代码是:

// Stripe New customer
  $customer = \Stripe\Customer::create(array(
    "email" => $customer_email,
    "source" => $token,
  ),
  array("stripe_account" => $connected_account)
  );

// Stripe Subscription
  $sub = \Stripe\Subscription::create(array(
    "customer" => $customer['id'],
    "items" => array(
      array(
        "plan" => $plan_id,
      ),
    ),
  ),
  array("stripe_account" => $connected_account)
  );

有什么想法吗?谢谢

【问题讨论】:

  • 您使用的是什么版本的条带?我不认识array("stripe_account" => $connected_account) 参数
  • @Wee 最后一个条纹版本

标签: php stripe-payments stripe-connect


【解决方案1】:

creating the customer 之后,creating the subscription 之前,create an invoice item 设置费。

当您创建订阅时,将立即创建第一张发票,该发票将包括客户的所有待处理发票项目。

有关发票项目的更多信息,请参阅https://stripe.com/docs/subscriptions/invoices#adding-invoice-items

【讨论】:

  • 谢谢它的工作,但 1 美元的费用发票已转移到 $connected_account,无论如何要转移到主要公司帐户?
  • @Rubyx 只是将$connected_account 设置为公司帐户
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-06-21
  • 2017-12-03
  • 2021-04-11
  • 1970-01-01
  • 2018-02-02
  • 2020-08-29
  • 1970-01-01
相关资源
最近更新 更多