Discourse サブスクリプションプラグイン

:discourse2: 概要 Discourse Subscriptions プラグインを使用すると、サイト所有者は、Discourse インスタンス上のグループへのアクセス権を付与する、定期購入および単発購入のサブスクリプションを販売できます。
:open_book: インストールガイド このプラグインは Discore コアにバンドルされています。プラグインを個別にインストールする必要はありません。

Discourse Subscriptions プラグインを使用すると、ユーザーが有料コンテンツにアクセスするために支払う、単発および定期購入のサブスクリプションを作成できます。これは、コミュニティのホスティング費用を賄うのに最適な方法です。

機能

Discourse Subscriptions プラグインは、以下の機能をサポートしています:

トップナビゲーションにある「Subscribe」ボタンをクリックすると、サイト用に設定したサブスクリプションがリスト表示されるサブスクリプションページ /s に移動します:

ユーザーが特定のプランの「Subscribe」ボタンのいずれかをクリックすると、そのプランの支払いページが開きます:

ユーザーが支払い詳細と住所を入力して「Subscribe」をクリックすると、「Thank you!」メッセージが表示され、請求ページに移動します:

ユーザーは自動的に選択したグループに追加されます。これにより、どのユーザーがサブスクライブしたかを簡単に確認でき、そのグループのみが閲覧できるカテゴリでゲート付きコンテンツを提供できます。

用語

  • サブスクリプション - サブスクリプションは、コミュニティ内のコンテンツへのアクセスを制御できる定期支払いプランです。サブスクリプションが作成または削除されると、サブスクリプションプランに関連付けられたユーザーグループからユーザーが追加または削除されます。サブスクリプションは製品とプランで構成されます。
  • 製品 - Stripe の用語における製品とは、あなたが販売しているものです。製品は 1 つ以上のプランを含むことができます。
    • 製品に説明を追加するには、「description」という名前のメタデータフィールドを追加し、それを使用してください。Markdown を使用できます。
  • プラン - プランには価格、定期サイクルが含まれ、サブスクライバーがアクセスするグループに関連付けられます。

:police_car_light: Stripe の秘密鍵を常に安全に保管し、保護してください。

:warning: Discourse インスタンスをシャットダウンしたり、このプラグインをアンインストールしたり、サイトがオフラインになった場合でも、Stripe はサブスクリプションがキャンセルされるまで顧客に引き続き請求し続けます。

設定

  1. プラグインをインストールして有効化
  2. 支払いゲートウェイ (Stripe) を設定
  3. Stripe で Webhooks とイベントを設定
  4. Stripe キー(公開鍵、秘密鍵、Webhook 秘密鍵)を Admin > Plugins > Installed > Subscriptions > Settings /admin/site_settings/category/discourse_subscriptions?filter=plugin%3Adiscourse-subscriptions. に追加
  5. 購入して参加するサブスクライバー用のグループを作成
  6. Admin > Plugins > Subscriptions で製品とプランを作成
  7. 利益!

支払いゲートウェイの設定

まず、Stripe 支払いゲートウェイのアカウントが必要です。開始するには、テストモードでアカウントを設定し、実際の取引を行わずに銀行口座を設定することなく、すべての動作を確認できます。プラグインにはテストモードの切り替え機能はありません。代わりに、開発者キー(pk_testsk_test で始まるもの)を使用してください。

Stripe アカウントでの Webhooks とイベントの設定

:bomb: Webhooks は、サブスクリプションのキャンセルを完全に機能させるために必須です。正しく設定されていることを確認してください。

Stripe でアカウントを作成したら、Stripe にウェブサイトのアドレスを通知する必要があります。これにより、特定のトランザクションについて通知を受け取ることができます。これは Stripe ダッシュボードの Endpoints > URL で入力できます。

Webhooks アドレス: [your server address]/s/hooks – ここで [your server address] は Discourse インストールの URL です。

また、Stripe に Webhook URL を通じて通知すべきイベントを伝える必要があります。

現在、Discourse Subscriptions は以下のイベントに対応しています:

  • customer.subscription.deleted
  • customer.subscription.updated
  • checkout.session.completed

Stripe API および Webhook キーをプラグイン設定に追加

Stripe はあなたのウェブサイトと通信するために承認が必要です。これを行うために、Stripe は Webhook 用のプライベートキーとパブリックキーのペア、および署名秘密鍵を発行します。

Webhook を承認するには、Stripe からの API キーと Webhook 秘密鍵を設定ページ(Developers 下)に追加します。

:warning: 本番環境のキーを追加すると、実際の支払いが行われます。テストを行う場合は、View test data モードに切り替え、Developers 下で pk_testsk_test キーを取得してください。

Stripe アカウント設定では、以下を確認してください:

これらのキーを Admin > Plugins > Installed > Subscriptions > Settings /admin/site_settings/category/discourse_subscriptions?filter=plugin%3Adiscourse-subscriptions. の適切な設定に追加します。

Discourse でのユーザーグループの設定

ユーザーが Discourse アプリケーションに正常にサブスクライブし、クレジットカードの取引が処理されると、ユーザーはユーザーグループに追加されます。ユーザーをユーザーグループに割り当てることで、ウェブサイト上でユーザーがアクセスできる内容を管理できます。ユーザーグループは Discourse の中核機能であり、このプラグインは、プランに関連付けられたグループからユーザーを追加または削除する以外は何も行いません。

1 つ以上の製品とプランを作成

Admin > Plugins > Subscriptions で「add a new Product」をクリックします。製品を保存したら、プランを追加できます。プランの価格と請求間隔は、一度作成すると変更できないことに注意してください。これは、サブスクリプション管理に関する混乱を防ぐためです。

Stripe ダッシュボードを確認すると、すべての製品とプランがリストされていることがわかります。Discourse Subscriptions はこれらをローカルに作成しません。これらは Stripe で作成されます。

テスト

以下のクレジットカード番号でテストしてください:

  • 4242 4242 4242 4242
  • 4111 1111 1111 1111(認証不要)
  • 4000 0027 6000 3184(認証必要)

他のテストカード番号については:Test card numbers | Stripe Documentation

/s にアクセスして、いくつかのテスト取引を入力してください。

本番環境への移行

本番環境に移行する準備ができたら、API キーと Webhook 秘密鍵を本番環境のキーに変更してください。ライブモードで新しい製品とプランを作成する必要があります。

Stripe Webhooks を正しく設定していない場合、何らかの理由(クレジットカードの有効期限切れなど)で定期支払いの処理に失敗しても、ユーザーは引き続きグループにアクセスできることに注意してください。Stripe によってサブスクリプションが自動的にキャンセルされるようにするには、Manage failed payments 設定を下図のように設定し、上記のように Webhooks を設定してください。

支払い情報の更新

ユーザーは請求ページにアクセスし、サブスクリプションの横にある編集ボタンをクリックすることで、個別のサブスクリプションに使用しているカードを更新できます。これにより、以下の画面が開きます:

Stripe Checkout と Stripe 価格表

サブスクリプションプラグインの製品およびチェックアウトページを置き換え、代わりに Stripe CheckoutStripe Pricing Tables を使用することもできます。

Stripe ダッシュボードで:

  1. Discourse で製品を作成した後、Products > Product catalog に移動
  2. 価格表に含めたい製品をクリック
  3. Edit product をクリック
  4. More Options をクリックし、Metadata に以下を入力:
    • Key: group_name
    • Value: Discourse 上のグループ名(例:trust_level_0
  5. Update product をクリックして保存

:red_exclamation_mark: グループ名が Discourse の User_Groups で選択されているグループと一致していることを確認してください

Stripe 価格表の作成

  1. Products > Pricing tables に移動
  2. 新しい表を作成し、直前に作成した製品を追加
  3. 表を公開後、埋め込みコード内にある価格表 ID(prctbl_... で始まる)をコピー
  4. 価格表 ID を discourse_subscriptions_pricing_table_id に貼り付け、サブスクリプション価格表設定を有効化
  5. 緑色のチェックマークをクリックして両方の設定を保存

推奨ステップ:

Stripe 内で価格表を設定する際は、チェックアウト完了後にユーザーをサイトにリダイレクトすることを推奨します。そうしないと、ユーザーはサイトに戻るリンクのない Stripe の確認ページに残ってしまいます。

サブスクリプションの場合、https://<your-site>/my/billing/subscriptions へのリダイレクトが適しています。単発支払いの場合は、https://<your-site>/my/billing/payments に直接リンクすることもできます。

自動税徴収

自動税徴収を有効にするには、discourse_subscriptions_enable_automatic_tax のサイト設定ボックスをチェックしてください。

有効にしても、Stripe インスタンスの税徴収設定が正しく行われていない場合、チェックアウト完了後にユーザーがこのポップアップを表示することがあります:

詳細については、このガイドを参照してくださいが、プラグインが適切な automatic_tax[enabled]=true パラメータ(ステップ 5)を渡しているため、行うべきことはほとんどありません。

登録設定も(ステップ 4)必ず設定してください:

以下は、税が自動的に徴収されたことを示す Stripe 内の Discourse Subscription プラグインの取引例です:

設定

名前 説明
discourse subscriptions enabled Discourse Subscriptions プラグインを有効化します。
discourse subscriptions extra nav subscribe メインナビゲーションに Subscribe ボタンを表示します。
discourse subscriptions public key Stripe Publishable Key
discourse subscriptions secret key Stripe Secret Key
discourse subscriptions webhook secret Stripe Webhook Secret
discourse subscriptions currency 基本通貨コード。サブスクリプションプラン作成時に上書き可能です。
discourse subscriptions campaign enabled このコミュニティへの金銭的支援を促進するためのキャンペーンバナーを有効化します。
discourse subscriptions campaign goal サポートキャンペーンの目標数値(サブスクライバー数または集めた金額)。
discourse subscriptions campaign type 実行するキャンペーンの種類(サブスクライバー数または月間集めた金額)を選択します。
discourse subscriptions campaign banner location キャンペーンバナーの位置(トップまたはサイドバー)を選択します。
discourse subscriptions campaign banner bg image キャンペーンバナーの背景として使用するカスタム画像をアップロードします。
discourse subscriptions campaign banner shadow color キャンペーンバナーのドロップシャドウの色を選択します。
discourse subscriptions campaign show contributors サブスクリプション製品の最近の購入者のアバターを表示します。
discourse subscriptions campaign product キャンペーンのボタンをクリックしたときにサポーターに送信する Stripe 製品 ID。この設定が空白の場合、サポーターはメイン製品ページに誘導されます。
discourse subscriptions campaign grant ユーザーにサブスクリプションの無料 1 ヶ月分を付与します。
discourse subscriptions pricing table id 埋め込みコードからの Stripe 価格表 ID
discourse subscriptions pricing table enabled Stripe 価格表の使用を有効化し、既存の Subscribe ページを置き換えます。
discourse_subscriptions_enable_automatic_tax 売上税の徴収を切り替えます。Stripe でのいくつかの設定が必要です。
discourse_subscriptions_enable_verbose_logging デバッグを支援するための詳細なログ記録を有効化します。本番環境では永続的に有効化しないでください。

:discourse2: 当社がホストしていますか? このプラグインは、Pro、Business、Enterprise ホスティングプランで利用可能です Subscriptions | Discourse - Civilized Discussion

「いいね!」 139
Steady plugin for community funding
ProCourse Memberships :money_with_wings:
Group membership subscriptions with profit split
Email drip campaign
Discourse Category Lockdown
How to give unpaid users limited access without making Discourse private?
Discourse for Membership Association Members?
Super simple Discourse-Wordpress-membership integration
Please suggest a good Discourse Plugin for Membership that supports Indian Payment Gateway
Login required after some days of free access
User can't repurchase a subscription product after canceling
Allow users to donate to pay hosting fees for a site
Send an invite to a user but complete their profile programmatically
User Card Directory
Multiple paywalls with common communication hub
Discourse Subscriptions + btcpayserver
Discourse subscriptions - changing price during recurring subscription
Any good Memberpress alternatives for wordpress?
Subscription Access To Discourse
Add user to group after purchase
Do I need Wordpress? Or Discourse can be my solution to ALL?
How to move Topics in Category into their own Pinned Topic inside new Categories?
Discourse Subscriptions - user not removed from group when subscription cancelled
Discourse Subscriptions - user not removed from group when subscription cancelled
Discourse vs Skool
Subscription Access To Discourse
Tax implication of funding a forum
Tick badge for username?
Subscription update problem
Setting up a subscription group
How would I install a cryptocurrency paywall?
Charging a membership fee
Discourse Subscriptions with Thrive Cart
Admin creating subscription for user
Plugin for charity donations?
Allow subscription of predetermined length
Link Sign Up to Subscriptions Plugin
User monetization with group access?
Allow option to open Stripe payment website
Embed a list of Discourse topics onto an external site
Is it possible to use the subscription plugin to limit creating topics in a category to subscribers?
Best approach to a landing page/payment front end
Managing consumable AI costs
Allow multiple ‘new topic’ drafts
Stripe iframe causes a blank page on my print layout
No 'deleted' event in Stripe?
Tell us how you manage subscriptions on Discourse
Addding a paid group who can reply to topics but not create them
Integration with WP membership Pro
Hosting questions
Alternative sign up pathways
Control Category Visibility and Access by User Levels
Tighter integration of account-creation and subscriptions?
Blank page when resuming discourse app
Does the Subscriptions plugin work with "one-off" payment pricing tables?
Subscriber group automation (Remove and Add users to specific group with subscription)
"Support Us" Banner Not Updating
Tip or Pay Button - for user post/content, does it exist already?
May I or can I monetize my forum?
May I or can I monetize my forum?
Bundling more popular plugins with Discourse core
Guest Gate Theme Component
Error loading route Caused by plugin 'discourse-subscriptions'
Why doesn't Discourse hosting include the Subscriptions plugin on the Starter plan?
Rebuild fails when these plugins are present
Changing excerpt length
Installing discourse for free?
Options to manage payments for paid Discourse communities
Using a plug-in to monetize my Discourse
ProCourse Memberships :money_with_wings:
UX: Add metadata to subscription page to improve SEO and link UI design
A feature request related to this plugin. Pointed questions or rewarded questions
Plugin to use Discourse for classified ads or as a job board?
Subscription Plugin not working (Error)
How to set message limits for user groups?
API POST for New User
ProCourse Memberships :money_with_wings:
Steady plugin for community funding
New customer setup
Discourse Category Lockdown
Making group joins automatic to an external pricing plan
Platform integration - videos
Any way to accept paypal or stripe payment at signup?
Looking for feedback on Discourse Subscriptons
WooCommerce Discourse Website newbie help
Switching to Discourse Subscriptions from WordPress Subscriptions
Integration with Wix.com membership to only let the paid member can access to Discourse
2020: The Year in Review
Managing Subscriptions through Wordpress (Ultimate Member + Paid Memberships Pro)
Discourse Unlock
How does uninstalling the Subscriptions plugin affect Stripe billing?
Memberful opinions?
Is there an E-commerce plugin for Discourse?
Memberful opinions?
Prefill custom html with user's email address?
Can't make the subscription plugin work
How to charge members for my Discourse website?
New site landing-page + discourse integration and marketing
Pay or Play usage?
Latest topics on homepage with only members to read in detail?
Banner text customization for Subscriptions plugin
Subscriptions: Change User's Plan
Donation Bar for House Ad
Can I use the Subscriptions plugin on my own server?
Limiting Subscription Length
Discourse Subscriptions - use API to find out product, plan and renewal date