【问题标题】:How to handle re-subscription to a Stripe plan with a trial period?如何处理重新订阅带有试用期的 Stripe 计划?
【发布时间】:2017-04-09 04:38:42
【问题描述】:

如果客户重新订阅有试用期的计划会怎样?

更准确地说:

  1. 客户订阅了具有 30 天试用期的计划。
  2. 当此试用期结束时,客户决定取消 订阅。
  3. 客户稍后重新订阅该计划。

他们会再次进入试用期吗?

我如何确定用户是否已用完试用期,以便在没有试用期的情况下处理他们的重新订阅?

【问题讨论】:

    标签: stripe-payments subscription trial


    【解决方案1】:

    我的解决方案:

    我检查客户是否取消了此计划的订阅。如果是这种情况,我会使用trial_end'now' 创建订阅:

    if len(stripe.Subscription.list(status='canceled', customer=stripe_customer_id, plan=plan_id)['data']) > 0:
        stripe.Subscription.create(
            customer=stripe_customer_id,
            plan=plan_id,
            trial_end='now')     
    else:                
        stripe.Subscription.create(
            customer=stripe_customer_id,
            plan=plan_id)  
    

    【讨论】:

      猜你喜欢
      • 2019-02-28
      • 2019-06-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-05
      • 2017-08-20
      • 2021-08-04
      • 1970-01-01
      相关资源
      最近更新 更多