# Enhancements to the Subscriptions Plugin

**URL:** <https://meta.discourse.org/t/enhancements-to-the-subscriptions-plugin/373165>\
**Category:** Development\
**Tags:** subscriptions\
**Created:** [July 7, 2025, 11:45am UTC](https://meta.discourse.org/t/enhancements-to-the-subscriptions-plugin/373165 "2025-07-07T11:45:25Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![SubStrider](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/substrider/32/512604_2.png) [@SubStrider](https://meta.discourse.org/u/SubStrider)\
**Post date:** [July 7, 2025, 2:35pm UTC](https://meta.discourse.org/t/enhancements-to-the-subscriptions-plugin/373165/5 "2025-07-07T14:35:03Z")

</div>

Have updated the first post with the repo.

### **Setup and Configuration Guide**

This guide will walk you through setting up the necessary payment providers and creating your first products and plans.

#### **1. Provider Setup**

First, navigate to `Admin > Settings > Plugins` and select your primary payment provider from the `discourse_subscriptions_payment_provider` setting. Then, follow the instructions for your chosen provider below.

##### **A) Configuring Stripe**

If you chose Stripe as your provider:

1. **Fill in API Keys:** In your Discourse settings, provide your Stripe API keys:

- `discourse_subscriptions_public_key` (Your Stripe **Publishable** key)
- `discourse_subscriptions_secret_key` (Your Stripe **Secret** key)

1. **Set up the Webhook:** This step is crucial for tracking recurring payments, cancellations, and other subscription events.

- In your **Stripe Dashboard** , navigate to **Developers \> Webhooks**.
- Click **“Add an endpoint”**.
- For the **Endpoint URL** , enter:`https://your-discourse-url.com/s/hooks`
- Click **“Select events”** and add the following three events:
  - `checkout.session.completed`
  - `customer.subscription.deleted`
  - `customer.subscription.updated`

- Click **“Add endpoint”**.
- On the next page, find the **Signing secret** (it starts with `whsec_...`).
- Copy this secret and paste it into the `discourse_subscriptions_webhook_secret` setting in Discourse.

##### **B) Configuring Razorpay**

If you chose Razorpay as your provider:

1. **Fill in API Keys:**

- In your **Razorpay Dashboard** , go to **Settings \> API Keys** to generate a new key pair.
- Copy your keys and paste them into the corresponding Discourse settings:
  - `discourse_subscriptions_razorpay_key_id`
  - `discourse_subscriptions_razorpay_key_secret`

1. **Set up the Webhook:** This step is crucial for confirming that a payment was successfully captured.

- In your **Razorpay Dashboard** , go to **Settings \> Webhooks**.
- Click **“+ Add New Webhook”**.
- For the **Webhook URL** , enter:`https://your-discourse-url.com/s/hooks/razorpay`
- Create a **Secret** and keep it safe for the next step.
- Under **Active Events** , select only **`payment.captured`**.
- Click **“Create Webhook”**.
- Copy the secret you just created and paste it into the `discourse_subscriptions_razorpay_webhook_secret` setting in Discourse.

* * *

#### **2. Creating Products and Plans**

Navigate to `Admin > Plugins > Subscriptions` to manage your products and plans.

##### **Create a Product**

1. Go to the **Products** tab.
2. Click **“Create New Product”**.
3. Fill in the details. The “Description” field supports markdown and will be shown to users on the new pricing page.

##### **Create Plans for the Product**

1. After creating a product, click the edit icon (✎) next to it.
2. In the **“Pricing Plans”** section, click **“Add New Plan”**.
3. You can create two types of plans:

- **To Create a Recurring Plan (e.g., Monthly/Yearly):**
  - Check the **“Recurring Plan?”** box.
  - Set the **Amount** and **Billing Interval** (month, year, etc.).
  - Assign it to a **User Group**.

- **To Create a One-Time, Time-Limited Plan (e.g., 30-Day Pass):**
  - Leave the **“Recurring Plan?”** box **unchecked**.
  - Set the **Amount**.
  - A new field, **“Duration (in days)”**, will appear. Enter the number of days the user should have access (e.g., `30`).
  - Assign it to a **User Group**.

* * *

#### **3. New Administrative Tools**

This version includes new tools for manually managing subscriptions.

- **Granting a Subscription:**
  - From the main `Admin > Plugins > Subscriptions` page, click the **“Grant Subscription”** button.
  - In the modal that appears, select a username and a plan.
  - If the chosen plan is a one-time plan, you can specify a duration in days. If you leave this blank, the user will be granted permanent access to the associated group.

- **Revoking a Subscription:**
  - Navigate to the **Subscriptions** tab in the admin section.
  - Any non-recurring subscription (i.e., Manual or Razorpay) will have a **“Revoke Access”** button.
  - Clicking this will immediately remove the user from the associated group, ending their access.

---

_[View the full topic](https://meta.discourse.org/t/enhancements-to-the-subscriptions-plugin/373165)._
