- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
是否可以在周期结束时而不是立即降级用户?我梳理了API Docs但一直无法弄清楚如何实现这一点。
作为解决方法,我目前立即取消用户的订阅,然后为他们订阅较少的订阅,试用到月底。但这是行不通的 - 我需要能够将降级推迟到期限结束(但在请求降级时用 Stripe“记录”它)。
显然,有一些方法可以通过 Webhook 回调和本地跟踪用户订阅来实现此目的,但我希望尽可能避免这种情况。
<小时/>编辑
在有人问之前 - 我正在使用 Temboo 的 PHP SDK。然而,我并不是在寻找特定于语言的方法,只是在寻找高级操作方法(如果可能的话)。
最佳答案
这里提出的大多数解决方案看起来都像是在 stripe 发布订阅计划后的黑客攻击,这可能是最优雅的解决方案。事实上, strip 文档有一个示例说明了完全相同的场景 here .
第 1 步:从您想要降级的现有订阅中获取 current_period_end
值。
第 2 步:根据现有订阅创建新的订阅计划。
$subscriptionSchedule = $stripe->subscriptionSchedules->create([
'from_subscription' => 'sub_G678SASEGF',
]);
第 3 步:更新新创建的计划,分为两个阶段。 phase 0
是在 current_period_end
结束的当前阶段,phase 1
是在 current_period_end
开始的下一个阶段降级的价格计划。
$stripe->subscriptionSchedules->update(
$subscriptionSchedule->id,
[
'end_behavior' => 'release',
'phases' => [
[
'start_date' => $current_period_start,
'end_date' => $current_period_end,
'items' => [
[
'price' => $current_price_id
],
],
],
[
'start_date' => $current_period_end,
'items' => [
[
'price' => $downgraded_price_id,
],
]
],
],
]
您始终可以检查订阅对象以查看是否有事件计划,然后检索计划以利用 future 的任何降级。这种方法的优点是它可以应用于任何降级和/或计费周期变化。使用答案中前面描述的多计划方法,一个订阅只能包含具有相同计费周期的项目。
关于stripe-payments - Stripe : downgrade a user at "period end",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16820212/
我正在尝试将 Heroku 上的 dyno 类型从“爱好”更改为“免费”。是否可以? 当我单击“更改 Dyno 类型”时,会出现一个对话框,但它没有“免费”选项。 最佳答案 目标是将 Dyno 层切换
为我的 ClickOnce 应用程序的用户提供降级到以前版本的方法的推荐方法是什么? (以防新版本不能在他们的机器上运行) 最佳答案 在 ClickOnce 部署设置中,将最低要求版本保留为旧版本。这
当我跑 dotnet restore (或在 Visual Studio 中运行包还原),我看到如下警告: /usr/local/share/dotnet/sdk/1.0.4/NuGet.target
我网站的某些页面出现 502 错误,我不明白为什么有些页面可以工作,但其他页面却显示此错误: Request Method:POST Status Code:502 Bad Gateway Refer
我创建了一个具有Docker支持的ASP CORE 1.1项目。它运行。 现在,当我将其降级为ASP Core 1.0并运行docker模式时,我得到了 The target process exit
我网站的某些页面出现 502 错误,我不明白为什么有些页面可以工作,但其他页面却显示此错误: Request Method:POST Status Code:502 Bad Gateway Refer
我有一个 React 应用,可让用户使用 Firebase 身份验证通过 Google 登录。 我成功登录 Google,它显示了我的个人资料图片。 然后,我从 Firebase 身份验证中删除了该帐
我在一个包里有这个: api.use([ 'kestanous:herald@1.1.3', 'kestanous:herald-email', ]); 正如预期的那样,Met
我在 RPi2 上的 Raspbian 上运行 ownCloud 安装,我刚刚运行: apt-get update apt-get dist-upgrade 现在,当我尝试在浏览器中访问我的 ownC
我一直在 git 分支上切换到 1.13.2 版本的 ember,现在我想在返回另一个分支时回到 1.11.1。 我一直在运行npm install和 bower install没有失败。 但是当我运
是否可以在周期结束时而不是立即降级用户?我梳理了API Docs但一直无法弄清楚如何实现这一点。 作为解决方法,我目前立即取消用户的订阅,然后为他们订阅较少的订阅,试用到月底。但这是行不通的 - 我需
我们的应用服务有免费和付费计划。用户可以将免费计划升级到付费计划,但我们提供“降级”到免费计划的可能性。在发布商门户上,免费计划可以从付费计划迁移,付费计划也可以从免费计划迁移。 但是在 Azure
我们的应用服务有免费和付费计划。用户可以将免费计划升级到付费计划,但我们提供“降级”到免费计划的可能性。在发布商门户上,免费计划可以从付费计划迁移,付费计划也可以从免费计划迁移。 但是在 Azure
我们开发了一个通过 Windows Installer 分发的应用程序,它是使用 WiX 创建的,我们的客户可以在其中从任何旧版本升级到最新版本。 然而,我们的最新版本删除了 2 个 dll,这只能通
我收到有关“软件包降级”的构建错误,例如: NU1605 Detected package downgrade: Microsoft.Extensions.Configuration.Json fr
我终于设法通过 dotnet restore 下载了一个项目的依赖项,经过全部清除过程后nuget缓存,dnx缓存,并更新 cli使用测试版 channel 。 但是使用 project.json下面
我们在 Azure VM 上的 2 个独立 Ultra 磁盘上有 tempdb 和日志文件。由于使用率不是那么高,我们希望将它们降级为高级 SSD。是否可以这样做,或者我们必须连接新的 SSD,将文件
我正在尝试用java编写这个程序。 我可以从构造函数中读取字符串并使用分隔符分隔字符串。但是,每次我尝试为这些值调用诸如 promote() 之类的方法时,该值都保持不变。 boolean 方法 pr
我正在创建一个返回 Weak 的函数对特征对象的引用。在找不到对象的情况下(它是一个查找函数),我想返回一个空的 Weak引用使用 Weak::new() : use std::rc::{self,
我试图更喜欢来自 CondaForge 的包(为了可用性和兼容性)。然而,Conda 似乎更喜欢来自其他 channel 的核心库版本(例如 NumPy)。 例如,当我尝试安装一个新库时,Conda
我是一名优秀的程序员,十分优秀!