67 lines
2.9 KiB
Markdown
67 lines
2.9 KiB
Markdown
# PeerTube plugin Sell Storage
|
|
|
|
## Table of Contents
|
|
|
|
- [About](#about)
|
|
- [Getting Started](#getting_started)
|
|
- [Usage](#usage)
|
|
|
|
## About <a name = "about"></a>
|
|
|
|
This plugin allow you to sell storage space to your users using Stripe subscription.
|
|
Payments are automated with Stripe.
|
|
|
|
## Getting Started <a name = "getting_started"></a>
|
|
This is the NCD fork of the [peertube-plugin-orion-sell-storage](https://git.ncd-serv.fr/ncd/Peertube-plugins/src/branch/master/peertube-plugin-ncd-sell-storage) PeerTube plugin. This fork at inception allows you to add five packages rather than the original three. Everything else is pretty much left as-is, unless I decide to work on it more.
|
|
Check [Prerequisites](#Prerequisites) to install this plugin
|
|
|
|
### Prerequisites
|
|
|
|
- Peertube >= v4.3.0
|
|
|
|
### Installing
|
|
|
|
- Go to your instance Admin
|
|
- Navigate to the "Plugins" page
|
|
- Search for "ncd-sell-storage"
|
|
- Click Install near the plugin name
|
|
|
|
## If installing locally
|
|
- Clone Git repository
|
|
- cd peertube-plugin-ncd-sell-storage
|
|
- yarn
|
|
- yarn build
|
|
- Install via PeerTube CLI
|
|
|
|
### Configuration
|
|
You need to configuration the plugin to work.
|
|
Create an account on https://stripe.com to start.
|
|
|
|
|
|
In your Stripe dashboard, you can test in "Test mode", and go live by unchecking "Test mode" in the top right.
|
|
To go in live mode, you need to fill form in Stripe side. We recommand you to test in Test mode the integration before go in live.
|
|
|
|
# Note: If you perform a transaction in Test Mode, you'll need to manually clear the subscription status because the webhook will not send back the correct validation response, meaning the changes will take effect but nothing will be charged. Use a dedicated test account.
|
|
|
|
First, go to the Developer tab, and navigate to "API Keys". Grab your Secret API key, and insert it in your plugin settings.
|
|
After that, always in the Developer tab, navigate to Webhook and create a webhook.
|
|
|
|
An example of webhook URL is available in your plugin settings.
|
|
Its like https://your-instance.tld/plugins/ncd-sell-storage/1.1.2/router/webhook
|
|
|
|
# Note: If you update the plugin, you'll have to update the webhook link in Stripe. Don't forget this!
|
|
|
|
Keep in mind, you need to update the webhook URL on stripe-side for each new plugin version, because the version is in the URL.
|
|
Now, configure your Currency and Page description in the plugin settings.
|
|
|
|
Its time to add your Plans! In stripe, go to Product page, and add new product. Set a name, description and the price.
|
|
After creation, go in this new Product and grab the "API ID" near the price field.
|
|
|
|
Now, you can continue configure your Plan (1, 2, 3, 4, 5) in the plugin settings.
|
|
Repeat this process for each plans. Add new product, and grab the API ID corresponding to this price to insert it in your Product ID field, in the plugin settings.
|
|
|
|
## Usage <a name = "usage"></a>
|
|
|
|
- Navigate to "My Account""
|
|
- Navigate to the new navigation link "My Subscription"
|