Braintree-javascript - 如何按使用量按月向用户收费?

Braintree-javascript - How to charge users monthly based on usage?

documentation 中彻底搜索基于使用情况的计划后,我对如何根据应用的使用情况每月向用户收费感到困惑。

例如,我的应用程序的客户会 post 列表。每个列表都有一个其他用户可以单击的按钮。我想按月向我的客户收费,并根据客户列表按钮的点击次数收费。点击列表按钮的次数越多,收取的金额就越大。如果那个月没有人点击按钮,那么每月账单将为 0。

由于我将按月向客户收费,因此我认为这会在 'Recurring Billing' 下进行。

我脑子里目前的工作是创建一个用户会订阅的成本为 0 的计划。然后在每个月底,根据按钮的点击次数(我跟踪),我会更新订阅价格。

这行得通吗?

如果是这样,有更好的方法吗?

如果没有,我应该如何实现这种计费行为?

感谢阅读。

完全披露:我在 Braintree 工作。

Recurring Billing is better suited for charging users on a monthly subscription basis with a relatively stable price. You may encounter difficulty because you cannot update the price of a subscription that is past due. There are also rules about when you can change the price of a subscription if you are based in the EU. There are mechanisms to increment a subscription price called add-ons,但这同样不是它们的预期用途。

由于您已经计划跟踪点击次数并每月更新订阅价格,我建议您只计算您希望向客户收取的价格,然后 generating a basic transaction 使用该金额而不是使用订阅定期计费功能。

我希望这有帮助。如果您对此或有关特定集成的任何其他细节有疑问,我建议联系 Braintree support team 讨论您的选择。