peertube-plugin-sell-storage 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +66 -29
  2. package/main.js +14 -14
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -3,7 +3,9 @@
3
3
  ## Table of Contents
4
4
 
5
5
  - [About](#about)
6
- - [Getting Started](#getting_started)
6
+ - [Prerequisites](#prerequisites)
7
+ - [Installation](#installation)
8
+ - [Configuration](#configuration)
7
9
  - [Usage](#usage)
8
10
 
9
11
  ## About <a name = "about"></a>
@@ -11,69 +13,104 @@
11
13
 
12
14
  This plugin allows you to sell storage space to your users using Stripe subscription. Payments are automated with Stripe.
13
15
 
14
- ## Getting Started <a name = "getting_started"></a>
16
+ This is a fork of [peertube-plugin-ncd-sell-storage](https://gitea.nicecrew.digital/matty/peertube-plugin-ncd-sell-storage). The most notable improvements are:
17
+ - Error free! **At the time of writing this**, the published version of ncd-sell-storage is outdated and therefore does not work despite the fix being available on their Git repository.
18
+ - Branding removed. ncd-sell-storage had hardcoded branding which was removed so this plugin is accessible by everyone.
19
+ - Custom billing portal for customers to manage their subscriptions.
20
+ - Imrpoved documentation. For example, the necessary API events for the Stripe webhook are documented.
15
21
 
16
- This is a fork of [peertube-plugin-ncd-sell-storage](https://gitea.nicecrew.digital/matty/peertube-plugin-ncd-sell-storage). Unfortunately, the published version on NPM is outdated **at the time of writing this** and therefore does not work despite the fix being available on their Git repository. For that reason, their repository was forked and published separately with the updated code.
22
+ As with [peertube-plugin-ncd-sell-storage](https://gitea.nicecrew.digital/matty/peertube-plugin-ncd-sell-storage), this fork allows you to add five different packages/subscriptions.
17
23
 
18
- Additionally, this plugin removes branding and allows users to set their own billing portal for customers.
19
-
20
- As with [peertube-plugin-ncd-sell-storage](https://gitea.nicecrew.digital/matty/peertube-plugin-ncd-sell-storage), this fork allows you to add five packages rather than three.
21
-
22
- Check [Prerequisites](#Prerequisites) to install this plugin
23
-
24
- ### Prerequisites
24
+ ## Prerequisites <a name="prerequisites"></a>
25
25
 
26
+ - Stripe API key
27
+ - Stripe webhook (see the [Configuration](#configuration) section)
28
+ - Stripe products (up to 5) for users to subscribe to
26
29
  - Peertube >= v4.3.0
27
30
 
28
- ### Installing
31
+ ## Installation <a name="installation"></a>
29
32
 
30
33
  - Go to your instance Admin
31
34
  - Navigate to the "Plugins" page
32
35
  - Search for "sell-storage"
33
36
  - Click Install near the plugin name
34
37
 
35
- ## If installing locally
38
+ ### If you're installing locally
36
39
  - Clone Git repository
37
40
  - cd peertube-plugin-sell-storage
38
41
  - yarn
39
42
  - yarn build
40
43
  - Install via PeerTube CLI
41
44
 
42
- ### Configuration
43
- You need to configuration the plugin to work.
45
+ ## Configuration <a name="configuration"></a>
46
+ You need a Stripe account as stated in the [Prerequisites](#prerequisites) section.
44
47
  Create an account on https://stripe.com to start.
45
48
 
46
49
 
47
- In your Stripe dashboard, you can test in "Test mode", and go live by unchecking "Test mode" in the top right.
48
- 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.
50
+ Once you've validated your email and inputted your business details, you can test in "Test mode", and go live by unchecking "Test mode". This option is found by hovering over your business name in the top left.
51
+ <img width="712" height="433" alt="image" src="https://github.com/user-attachments/assets/f9ee2825-45ab-4ae4-8402-2c26acba01b5" />
49
52
 
50
- ### 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.
53
+ We recommend you to test the plugin in "Test mode" before going into "Live mode" (i.e. dealing with real money).
51
54
 
52
- First, go to the Developer tab, and navigate to "API Keys". Grab your Secret API key, and insert it in your plugin settings.
55
+ **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.**
53
56
 
54
- After that, always in the Developer tab, navigate to Webhook and create a webhook with the following API events:
55
- - `checkout.session.completed`
57
+ ### API Keys
58
+
59
+ You need the Secret API Key to add to the plugin configuration. Navigate to https://dashboard.stripe.com/apikeys. Copy and paste the Secret API Key into the plugin settings.
60
+
61
+ <img width="1524" height="327" alt="image" src="https://github.com/user-attachments/assets/250e4f8e-3652-4582-b710-6d57882b3fa2" />
62
+
63
+
64
+ ### Webhook configuration
65
+
66
+ Go to https://dashboard.stripe.com/webhooks and create a webhook with the following API events:
56
67
  - `customer.subscription.created`
57
68
  - `customer.subscription.deleted`
58
69
  - `customer.subscription.trial_will_end`
59
70
  - `customer.subscription.updated`
71
+ - `checkout.session.completed`
60
72
  - `invoice.paid`
61
73
  - `invoice.payment_failed`
62
74
  - `payment_intent.succeeded`
63
75
 
64
- An example of webhook URL is available in your plugin settings. An example is also shown here:
65
- https://your-instance.tld/plugins/sell-storage/1.1.3/router/webhook
76
+ For the webhook URL, make sure the version in the URL matches the version of the plugin. For example, if your plugin is on version `1.1.6` use the URL:
77
+ `https://your-instance.tld/plugins/sell-storage/1.1.6/router/webhook`
66
78
 
67
- ### Note: If you update the plugin, you'll have to update the webhook link in Stripe with the new version. For example, update 1.1.3 to 1.1.4. Don't forget this!
79
+ An example of this with the correct version in the webhook URL is available in the plugin settings.
68
80
 
69
- Now, configure your billing portal, currency, page and description in the plugin settings.
81
+ **Note: If you update the plugin, you'll have to update the webhook link in Stripe with the new version. For example, if you update from 1.1.3 to 1.1.6 change the webhook URL to `https://your-instance.tld/plugins/sell-storage/1.1.6/router/webhook`. Don't forget this!**
70
82
 
71
- Its time to add your Plans! In stripe, go to Product page, and add new product. Set a name, description and the price.
72
- After creation, go in this new Product and grab the "API ID" near the price field.
83
+ ### PeerTube Plugin
73
84
 
74
- Now, you can continue configure your Plan (1, 2, 3, 4, 5) in the plugin settings.
75
- 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.
85
+ Configure the following settings:
86
+ - Billing portal URL (enabled and customised at https://dashboard.stripe.com/settings/billing/portal)
87
+ - Currency
88
+ - Page description, thank you page description and cancel page description.
89
+
90
+ ### Plan configuration
91
+ It's time to add your plans!
92
+
93
+ 1. In stripe, go to https://dashboard.stripe.com/products and add a new product. Set a name, description and price.
94
+ After creation, click on the product and click on the binocular icon at the bottom right.
95
+ <img width="405" height="62" alt="image" src="https://github.com/user-attachments/assets/8b5f95f8-e20a-4cb2-b9e4-872c48ae86e5" />
96
+
97
+ &nbsp;
98
+
99
+ 2. On the left side of the inspection window, click on the price key.
100
+ <img width="395" height="300" alt="image" src="https://github.com/user-attachments/assets/c20b5320-f88c-4c4f-820b-f9188b84efde" />
101
+
102
+ &nbsp;
103
+
104
+ 3. On the right side of the inspection window, copy the price ID into the respective plan in the plugin settings.
105
+ <img width="436" height="319" alt="image" src="https://github.com/user-attachments/assets/017ced89-6ab5-4b53-8565-93bf1ec0c5f5" />
106
+
107
+ &nbsp;
108
+
109
+ Repeat steps 1-3 for each plan (1, 2, 3, 4, 5) in the plugin settings.
76
110
 
77
111
  ## Usage <a name = "usage"></a>
78
112
 
79
- - Navigate to "Storage Plan" underneath "My video space" in the PeerTube menu
113
+ Navigate to "Storage Plan" underneath "My video space" in the PeerTube menu
114
+
115
+ <img width="212" height="258" alt="image" src="https://github.com/user-attachments/assets/05d4b7a2-0964-4bf2-9981-251f32b162b3" />
116
+
package/main.js CHANGED
@@ -376,7 +376,7 @@ function registerMenuSettings(registerSetting) {
376
376
  label: "Stripe Billing Portal",
377
377
  type: "input",
378
378
  private: false,
379
- descriptionHTML:" "The Stripe billing portal where customers can manage their subscriptions. Enabled at: https://dashboard.stripe.com/settings/billing/portal",
379
+ descriptionHTML: "The Stripe billing portal where customers can manage their subscriptions. Enabled at: https://dashboard.stripe.com/settings/billing/portal",
380
380
  default: ""
381
381
  });
382
382
 
@@ -400,7 +400,7 @@ function registerMenuSettings(registerSetting) {
400
400
  type: "markdown-enhanced",
401
401
  private: false,
402
402
  descriptionHTML: "You can explain what you want, it is showed on the page. Leave it empty to show default localized description.",
403
- default: "You **want tu spport us** ? Or **need more space** ? Your in the right place!"
403
+ default: "If you need more storage space, please contact us using the contact form."
404
404
  });
405
405
 
406
406
  registerSetting({
@@ -409,7 +409,7 @@ function registerMenuSettings(registerSetting) {
409
409
  type: "markdown-enhanced",
410
410
  private: false,
411
411
  descriptionHTML: "If you want to show a text on the Success page after payment",
412
- default: ""
412
+ default: "Thanks for your support!"
413
413
  });
414
414
 
415
415
  registerSetting({
@@ -418,7 +418,7 @@ function registerMenuSettings(registerSetting) {
418
418
  type: "markdown-enhanced",
419
419
  private: false,
420
420
  descriptionHTML: "If you want to show a text on the Cancel page after payment canceled",
421
- default: ""
421
+ default: "Have a great rest of your day!"
422
422
  });
423
423
 
424
424
 
@@ -440,7 +440,7 @@ function registerMenuSettings(registerSetting) {
440
440
  type: "input",
441
441
  private: false,
442
442
  descriptionHTML: "Specify the name of your plan",
443
- default: "Starter plan",
443
+ default: "Starter Plan",
444
444
  });
445
445
 
446
446
  registerSetting({
@@ -457,7 +457,7 @@ function registerMenuSettings(registerSetting) {
457
457
  label: "Plan price /month",
458
458
  type: "input",
459
459
  private: false,
460
- descriptionHTML: "Specify the price /month users pay for this plan",
460
+ descriptionHTML: "Specify the price per month users pay for this plan",
461
461
  default: 5,
462
462
  });
463
463
 
@@ -482,7 +482,7 @@ function registerMenuSettings(registerSetting) {
482
482
  type: "input",
483
483
  private: false,
484
484
  descriptionHTML: "Specify the name of your plan",
485
- default: "Community plan",
485
+ default: "Community Plan",
486
486
  });
487
487
 
488
488
  registerSetting({
@@ -499,7 +499,7 @@ function registerMenuSettings(registerSetting) {
499
499
  label: "Plan price /month",
500
500
  type: "input",
501
501
  private: false,
502
- descriptionHTML: "Specify the price /month users pay for this plan",
502
+ descriptionHTML: "Specify the price per month users pay for this plan",
503
503
  default: 10,
504
504
  });
505
505
 
@@ -523,7 +523,7 @@ function registerMenuSettings(registerSetting) {
523
523
  type: "input",
524
524
  private: false,
525
525
  descriptionHTML: "Specify the name of your plan",
526
- default: "Profesionnal plan",
526
+ default: "Professional Plan",
527
527
  });
528
528
 
529
529
  registerSetting({
@@ -540,7 +540,7 @@ function registerMenuSettings(registerSetting) {
540
540
  label: "Plan price /month",
541
541
  type: "input",
542
542
  private: false,
543
- descriptionHTML: "Specify the price /month users pay for this plan",
543
+ descriptionHTML: "Specify the price per month users pay for this plan",
544
544
  default: 15,
545
545
  });
546
546
 
@@ -564,7 +564,7 @@ function registerMenuSettings(registerSetting) {
564
564
  type: "input",
565
565
  private: false,
566
566
  descriptionHTML: "Specify the name of your plan",
567
- default: "Profesionnal plan",
567
+ default: "Professional Plan",
568
568
  });
569
569
 
570
570
  registerSetting({
@@ -581,7 +581,7 @@ function registerMenuSettings(registerSetting) {
581
581
  label: "Plan price /month",
582
582
  type: "input",
583
583
  private: false,
584
- descriptionHTML: "Specify the price /month users pay for this plan",
584
+ descriptionHTML: "Specify the price per month users pay for this plan",
585
585
  default: 15,
586
586
  });
587
587
 
@@ -605,7 +605,7 @@ function registerMenuSettings(registerSetting) {
605
605
  type: "input",
606
606
  private: false,
607
607
  descriptionHTML: "Specify the name of your plan",
608
- default: "Profesionnal plan",
608
+ default: "Professional Plan",
609
609
  });
610
610
 
611
611
  registerSetting({
@@ -622,7 +622,7 @@ function registerMenuSettings(registerSetting) {
622
622
  label: "Plan price /month",
623
623
  type: "input",
624
624
  private: false,
625
- descriptionHTML: "Specify the price /month users pay for this plan",
625
+ descriptionHTML: "Specify the price per month users pay for this plan",
626
626
  default: 15,
627
627
  });
628
628
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "peertube-plugin-sell-storage",
3
3
  "description": "Updated and republished version of peertube-plugin-ncd-sell-storage to sell storage to users using Stripe",
4
- "version": "1.1.4",
4
+ "version": "1.1.6",
5
5
  "author": "AyaaDev",
6
6
  "bugs": "https://github.com/ayaadev/peertube-plugin-sell-storage",
7
7
  "clientScripts": [