# 允许订阅预定长度

**URL:** <https://meta.discourse.org/t/allow-subscription-of-predetermined-length/246395>\
**Category:** Feature\
**Tags:** subscriptions\
**Created:** [2022年十一月22日 12:05 UTC](https://meta.discourse.org/t/allow-subscription-of-predetermined-length/246395 "2022-11-22T12:05:36Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![spirobel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spirobel/32/170908_2.png) [@spirobel](https://meta.discourse.org/u/spirobel)\
**Post date:** [2023年九月7日 10:35 UTC](https://meta.discourse.org/t/allow-subscription-of-predetermined-length/246395/17 "2023-09-07T10:35:53Z")

</div>

@Alex_王 @Jonathan5 @nathank

如果你愿意，可以试用更新后的代码。你可以从这个 PR 中检出分支：

> <https://github.com/spirobel/discourse-subscriptions/pull/2>

你需要在本地运行 stripe cli 来转发 webhook 消息。这是要使用的命令：

```plaintext
stripe listen --forward-to http://localhost:4200/subscriptions/hooks --api-key your_api_key

```

你还需要将 stripe webhook 密钥添加到 discourse 实例（作为插件设置“webhook secret”）。你可以在 stripe 上的 webhook 创建表单中找到它，就在右侧的代码示例中。

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/b/e/1be89e714a506cc27fd6cc3ef7049fa068639952.png)

我制作了一个短视频，概述了数据结构以及它们如何与 Discourse 数据结构连接：  
 ![](https://cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/meta/optimized/4X/2/5/1/251dc2b19d7a46b50a6b14dea0b5da6b025aa2e1_2_690x388.jpeg)https://www.youtube.com/embed/FTDunlbsGDs?feature=oembed&wmode=opaque

> [@Jonathan5](#):
>
> 我不记得 Stripe 的术语了，但整个插件都围绕着他们旧的做事方式（只允许信用卡）而不是新的方式（允许各种支付选项）。

我基本同意这一点，但现在应该已经修复了。你可以在 Stripe 中配置任何你想要的东西（支付方式/税费/定价表等），并且它们都应该能正常工作。

该插件仅管理 Discourse 用户和 Stripe 客户之间的连接，产品的创建、计划等完全在 Stripe 的仪表板中完成。

仍然可能存在 bug。如果你发现任何问题，请报告。😀 👍

---

_[View the full topic](https://meta.discourse.org/t/allow-subscription-of-predetermined-length/246395)._
