2016-11-24 57 views
0

如果客戶重新訂購有試用期的計劃,會發生什麼情況?如何在試用期內處理重新訂閱條紋計劃?

爲了更精確:

  1. 一位顧客預訂了30天試用期的計劃。
  2. 當此試用期結束時,客戶決定取消 訂閱。
  3. 客戶後來重新訂閱該計劃。

他們能否再次進入審判日?

我如何能夠確定用戶是否已經使用了試用期,以便我可以在沒有試用期的情況下處理其重新訂閱?

回答

2

我的解決辦法:

我檢查,如果客戶有此計劃取消訂閱。如果是這種情況,我創建訂閱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)