条带:将用户在“期限"降级 [英] Stripe: downgrade a user at "period end"

查看:68
本文介绍了条带:将用户在“期限"降级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在期末而不是立即将用户降级?我已经仔细阅读过 API文档,但是还无法弄清楚该如何实现.

作为一种解决方法,我目前正在立即取消用户的订阅,然后将其订阅较小的订阅,直到月底试用.但这行不通-我需要能够将降级延迟到期末(但在请求降级时,请使用Stripe对其进行记录").

很显然,可以通过webhook回调和本地跟踪用户订阅来实现此目的,但我想尽可能避免这种情况.


编辑

在有人问之前-我正在使用Temboo的PHP SDK.但是,我不是在寻找特定于语言的方法,而只是在寻求高级指导(如果可能).

解决方案

正如@Safinn和@Martin所述,您可以使用at_period_end: true取消订阅,以在特定日期执行取消操作.

为了降级到其他计划,我的解决方法是执行上述操作,然后为在相同日期/时间结束的新计划创建免费试用版.这样,旧计划将在新计划的试用期结束的同一天被取消(从而使其生效).

这使Stripe完全可以完成降级的操作(IMHO应该更直接),而不是在数据库中设置Webhook或跟踪日期.

Is it possible to downgrade a user at period end instead of immediately? I've combed through the API Docs but haven't been able to figure out how to accomplish this.

As a workaround I'm currently immediately canceling the user's subscription, then subscribing them to the lesser subscription, trialing until the end of the month. This won't work though - I need to be able to delay the downgrade until the period end (but "record" it w/ Stripe at the time the downgrade is requested).

Clearly there are ways to accomplish this with webhook callbacks and by tracking user subscriptions locally but I'd like to avoid that if possible.


EDIT

Before anyone asks - I'm using Temboo's PHP SDK. However I'm not looking for a language-specific approach, just a high level how-to (if it's possible).

解决方案

As @Safinn and @Martin have mentioned, you can cancel the subscription using at_period_end: true to action the cancellation on a specific date.

In order to downgrade to a different plan, the way I get around it is to do the above and then create a free trial of the new plan ending on the same date/time. This way the old plan will be cancelled on the same date that the new plan's trial will end (causing it to be active).

This lets Stripe handle the downgrade entirely their end (which should be more straightforward IMHO), rather than setting up webhooks or tracking dates in your database.

这篇关于条带:将用户在“期限"降级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆